Turning Point Academy · MCP Engineering

Tool design and context efficiency — Cheat Sheet

MCP Engineering course · M4


The printable companion to lesson L15. Every tool you expose takes space in the model's context and competes for its attention. This sheet separates the levers that are part of MCP (current spec 2026-07-28, they work with any compliant host) from the techniques that belong to a host or model platform, and gives each published figure with its correct attribution.

What changed in V2: the earlier version of this sheet credited the 150,000 → 2,000 token figure to Programmatic Tool Calling (it belongs to Anthropic's "Code execution with MCP" post), presented Tool Search as a generic MCP technique (it is a Claude Developer Platform feature), and cited video timestamps. All corrected below. The "many tools vs code" debate is in the companion guided reading.

Why many tools hurt

Levers that are part of MCP (current, 2026-07-28)

They live in your server, so they help every compliant host:

LeverWhat to do
CurateA few task-level tools, not one per endpoint (L11: three tools; the admin DELETE stayed out).
Name and describe preciselyNames SHOULD be 1–128 characters from A-Z a-z 0-9 _ - ., unique per server. Put constraints in the schema (enums, ranges, patterns) instead of long prose.
Return structureDeclare an outputSchema and return structuredContent, plus the JSON as a text block for compatibility.
Point, don't pasteReturn a resource_link to large data instead of inlining it.
PaginatePaginate list results.
Deterministic orderServers SHOULD return tools/list in a stable order (client caching, prompt-cache hits).
Cache hintstools/list results carry ttlMs and cacheScope.
Scope by authorizationtools/list MAY return only the tools the caller's granted scopes permit.

Techniques that belong to the host or API (host-specific)

TechniqueWhat it doesFigure and source
Tool Search Tool with defer_loading: true (Claude Developer Platform, beta header advanced-tool-use-2025-11-20)Loads tool definitions on demand; can defer a whole MCP server through an mcp_toolset settingAbout 77K → about 8.7K tokens of tool context in Anthropic's example ("Advanced tool use", 2025-11-24)
Programmatic Tool Calling (same platform, same beta)The model writes code that calls tools; intermediate results stay out of contextAverage usage 43,588 → 27,297 tokens, a 37% reduction on complex research tasks (same post)
Code execution with MCP (an agent-harness pattern)MCP tools are presented as code files; the agent loads only what it needs and moves data in code150,000 → 2,000 tokens (98.7%) for one Google Drive to Salesforce example ("Code execution with MCP", 2025-11-04)

Two attribution traps:

The safety rule that is not optional

Running model-written code needs a sandbox. The code-execution post says it "requires a secure execution environment with appropriate sandboxing", which adds operational overhead and security considerations that direct tool calls avoid. Never run that code loose; limit egress and secrets (L14).

A decision method (rules of thumb, not measured thresholds)

  1. Start with a handful of explicit, task-level tools. Most servers never need more.
  2. Measure the size of your tools/list and watch for wrong-tool choices in your host's traces.
  3. If the catalog must grow, first use the MCP levers: merge similar tools, tighten schemas, link instead of inlining, scope tools by authorization.
  4. If your host offers deferred loading, enable it for big catalogs. That is a host setting, not a change to your server.
  5. Move to code execution only for multi-step, data-heavy flows, and only with a sandbox.

Practice: measure your tool budget (lab-l11)

With the L11 lab running (./run.sh serve), save as tool_budget.py in lab-l11/ and run .venv/bin/python tool_budget.py twice:

import asyncio, json
from mcp import Client

async def main() -> None:
    async with Client("http://127.0.0.1:8000/mcp") as client:
        tools = (await client.list_tools()).tools
        total = 0
        for t in tools:
            size = len(json.dumps(t.model_dump(by_alias=True, exclude_none=True)))
            total += size
            print(f"{t.name:15} {size:5} chars")
        print(f"TOTAL {total} chars, {len(tools)} tools, order: {[t.name for t in tools]}")

asyncio.run(main())

Expected on the unmodified lab (2026-11-26): search_items 1401, get_item 839, reserve_stock 917, TOTAL 3157 chars, and the same order: list on both runs (deterministic ordering). Characters are only a rough proxy for tokens, but good enough to compare designs.

Quick glossary

To remember

  1. More tools ≠ more power. Definitions and intermediate results both cost context.
  2. MCP levers first: curate, tight schemas, structured output, resource_link, pagination, deterministic order, cache hints.
  3. Tool Search and Programmatic Tool Calling are platform features, not MCP.
  4. 150K → 2K = Code execution with MCP; 37% = Programmatic Tool Calling. Never swap them.
  5. Model-written code requires a sandbox.

Turning Point Academy · MCP Engineering course · Module 4 · Lesson 15 (L15) · V2, spec 2026-07-28