Skip to content

Conversation

@birdayz
Copy link
Contributor

@birdayz birdayz commented Aug 7, 2025

Adds support for extending MCP tool schemas with arbitrary properties beyond the base protobuf definition.

New capabilities:

  • Add custom fields to tool schemas (name, description, required flag)
  • Extract values from MCP arguments and inject into request context
  • Support any context key type for value retrieval
  • Multiple extra properties per tool

Usage:

runtime.WithExtraProperties(
    runtime.ExtraProperty{
        Name: "api_url", 
        Description: "API endpoint", 
        Required: true,
        ContextKey: MyContextKey{},
    },
)

Enables dynamic configuration and schema flexibility for MCP tools.

@birdayz birdayz force-pushed the jb/middleware branch 2 times, most recently from b6dd750 to c5cb11b Compare August 7, 2025 13:42
@birdayz birdayz changed the title add host override key add url override option Aug 7, 2025
allows dynamic discovery of base url, allowing the LLM to input an
additional field for the url.
@birdayz birdayz force-pushed the jb/middleware branch 3 times, most recently from fb80c79 to 860e7d5 Compare August 7, 2025 15:51
@birdayz birdayz changed the title add url override option refactor: generalize URL override to generic extra properties Aug 7, 2025
@birdayz birdayz marked this pull request as ready for review August 7, 2025 17:30
- Replace WithBaseURLProperty with WithExtraProperties supporting arbitrary fields
- Add configurable field name, description, required flag, and context key
- Remove URLOverrideKey in favor of user-provided context keys
- Maintain backward compatibility for URL parsing in user code
@birdayz birdayz merged commit 10b1375 into main Aug 7, 2025
4 checks passed
@birdayz birdayz deleted the jb/middleware branch August 7, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants