Skip to content

Search articles, repositories, topics and pages.

MCP

A Small MCP Trick

Returning a short summary plus a resource link from MCP tools keeps the context window small without hiding details.

TIAN NEWS AI

Published Updated 1 min read

An MCP tool returning a concise summary and a resource URI that the client can resolve for full details

The problem

One of my MCP tools returned full database rows. After a few calls, the conversation was mostly JSON and the model started losing track of the question.

The trick

Return a short summary from the tool and expose the full record as a resource. The model sees the summary immediately. If the host supports MCP resources and chooses to expose one to the model, the client can resolve the URI when the task needs more detail.

json
{
  "summary": "3 open incidents, highest severity: high",
  "resource": "incidents://open"
}

The model's context grows by one line per call instead of hundreds, while the full data remains available through a separate read. That second read still depends on client support, authorization and the resource remaining available.

Key takeaway

Tools should answer the question; resources can hold the details.

  1. MCP resources specification — resources are application-driven context exposed by servers and selected by host applications.

Updated

Topics

Related reading

  • Five Prompting Patterns I Keep Using

    A short collection of prompting patterns that consistently work in real projects, with one example each.

    1 min read

  • Building a Reliable MCP Server

    A production-minded guide to building an MCP server that stays predictable under bad inputs, upstream failures, cancellation and real clients.

    8 min read

  • Survival Rules for Working with Claude Code

    An evidence-graded field guide to using Claude Code safely and reproducibly: constrain the task, protect the context window, verify every change and automate only inside explicit boundaries.

    10 min read

  • Understanding Memory in AI Agents

    A rigorous guide to agent memory as a governed state subsystem: what is stored, how it is updated and retrieved, and how to evaluate it safely.

    11 min read