Skip to content

vMCP find_tool should have a dynamic description based on available tools #4357

@jerm-dro

Description

@jerm-dro

Problem

When using the vMCP optimizer, LLM agents often don't call find_tool because its generic description doesn't give them enough context about what tools are available behind it. Agents tend to reach for built-in tools (like bash, curl, or gh) instead, making it difficult to rely on the optimizer in practice.

This has been observed across multiple clients — Claude Code handles it best but still falls back to other approaches; Cursor and Copilot are significantly worse.

Proposed Solution

Allow the vMCP operator to manually configure a custom description for find_tool via OptimizerConfig. This description is global — all users see the same description regardless of their permissions.

For example, an operator could set the description to:

"Search for available tools. I have tools for accessing GitHub and Datadog."

This gives the LLM agent a hint about what capabilities are behind find_tool, making it far more likely to actually call it.

Solution sketch

1. Add FindToolDescription to OptimizerConfig (pkg/vmcp/config/config.go):

type OptimizerConfig struct {
    // ... existing fields ...

    // FindToolDescription overrides the default find_tool tool description.
    // Use this to hint at the kinds of tools available behind the optimizer
    // (e.g. "Search for tools. I have tools for GitHub, Datadog, and Slack.").
    // When empty, the built-in default description is used.
    // +optional
    FindToolDescription string `json:"findToolDescription,omitempty" yaml:"findToolDescription,omitempty"`
}

2. Pass the description through NewDecorator (pkg/vmcp/session/optimizerdec/decorator.go):

func NewDecorator(sess sessiontypes.MultiSession, opt optimizer.Optimizer, findToolDesc string) sessiontypes.MultiSession {
    if findToolDesc == "" {
        findToolDesc = defaultFindToolDescription
    }
    return &optimizerDecorator{
        MultiSession: sess,
        opt:          opt,
        optimizerTools: []vmcp.Tool{
            {
                Name:        FindToolName,
                Description: findToolDesc,
                InputSchema: findToolInputSchema,
            },
            // ... call_tool unchanged ...
        },
    }
}

3. Thread it through the factory (pkg/vmcp/server/sessionmanager/factory.go):

The optimizerDecoratorFn already has access to the config. Pass OptimizerConfig.FindToolDescription into NewDecorator at line 190.

Future improvements (out of scope)

  • Per-permission dynamic descriptions (e.g. if a user has access to tool set X, concatenate a relevant hint to the base description)
  • LLM-generated summaries that automatically describe available tools based on the indexed backends

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestvmcpVirtual MCP Server related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions