Skip to content

MCP server/tool instructions add a lot of bloat to initial system context even if using "lazy" tool discovery #684

Open

Description

@stsquad

I noted this with semcode which offers a --lazy flag to reduce the initial context cost of the MCP. It dutifully advertises only:

<deferred-tool name="semcode__call_tool" description="Execute a semcode tool by name with given arguments. Use get_tools first to see the required arguments."/>
<deferred-tool name="semcode__get_tools" description="Get the full schema for tools in a category. Use this to get tool details before calling them."/>
<deferred-tool name="semcode__list_categories" description="List available tool categories. Call this first to discover what semcode can do."/>

as tools but then ECA dump the entire instructions file in the MCP server instructions. Arguably this could be described as semcode's issue (and will prepare a patch for it) however it does raise a bigger question about how ECA approaches managing it's context. There seems to be a variety of approaches that the various agents do from suppressing completely to having their own custom instructions schemas. I thought it would be worth raising this issue to discuss the various context management approaches ECA could take.

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Activity

  1. zikajk commented on Oct 30, 2026

    @zikajk
    Member

    @stsquad Have you tried mcpSearchTool, doesn't it solve the problem for you?

  2. stsquad commented on Oct 30, 2026

    @stsquad
    Author
    1. @stsquad Have you tried mcpSearchTool, doesn't it solve the problem for you?

    I have:

        "mcpToolSearch": {
            "includePattern": [".*"]
        },
    

    but I still see the instructions dumped in the initial prompt.

  3. zikajk commented on Oct 30, 2026

    @zikajk
    Member

    Do you know what might be the problem here @ericdallo @rschmukler?

  4. rschmukler commented on Oct 30, 2026

    @rschmukler
    Contributor

    It might still be beaving "correctly" (as in, as intended) - when I implemented it I decided to have it send a truncated version of the tool description (just the first paragraph, max of 250 characters) even if it was deferred. Can you confirm if the schemas are being omitted?

    The full description (if over 1 paragraph) + the tool call schemas are what are deferred. In the MCP servers that I use most frequently this ended up getting rid of a lot of the bloat.

    It's a trade-off between making the agent know that it could exist (which pushes it to finding the tool later when it needs it) versus saving context maximally. This was an attempt to strike that balance.

    I think we could potentially make it configurable - ie. eca could send truly nothing, just the tool names, or the tool names + truncated descriptions; that being said, at least with my use cases this ended up being the "sweet spot".

  5. stsquad commented on Nov 3, 2026

    @stsquad
    Author

    I certainly wasn't seeing the truncated description but the whole of instructions which is more than a paragraph. I have submitted a PR on semcodes side which does work.

  6. ericdallo commented on Nov 3, 2026

    @ericdallo
    Member

    I couldn't find anything to improve besides a configurable flag as mentioned, besides that seems like something to be fixed on semcode, LMK if you think we should prioritize the config flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions