Skip to content

Reduce MCP server token footprint (tracking) #666

@jirispilka

Description

@jirispilka

Goal

Incrementally reduce the token footprint of the MCP server tools. Current baseline: 8 tools, ~5,697 tokens.

The server instructions + tool descriptions + input schemas are sent to every LLM conversation. Fewer tokens = faster responses, lower cost, more room for actual user context.

Approach

Each sub-issue targets one area. Changes must not break LLM behavior — validate with evals before/after.

Sub-issues

To be filed individually and linked here.

Server instructions (src/utils/server-instructions/)

  • Trim common preamble — remove obvious/redundant bullet points (e.g. "Actors take input and produce output")
  • Condense tool disambiguation section — merge overlapping rules

Tool descriptions

  • search-actors (~2,400 chars) — largest description, heavy on examples and rules that could be shorter
  • call-actor (~1,800 chars across constants) — MCP server section + usage section + examples can be tightened
  • search-apify-docs — dynamically built, review source list verbosity

Input schemas

  • Trim verbose .describe() strings in Zod schemas (e.g. search-actors keywords has a ~900 char description with examples)
  • Review call-actor parameter descriptions (memory, timeout bounds are restated in both describe + zod constraints)

Output schemas

  • Review structured output schemas for unnecessary fields

Measurement

After each change, measure with: └ apify-dev: 8 tools (~N tokens) in Claude Code status line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-aiIssues owned by the AI team.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions