Skip to content

Allow function argument to be excluded from the tool's JSON schema #574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martina-zxy
Copy link

@martina-zxy martina-zxy commented Apr 23, 2025

Add client_provided_arg_model to FuncMetadata to allow certain arguments to be excluded from the JSON schema. This creates a cleaner interface for LLMs while still providing the necessary context at execution time.

Motivation and Context

With the current implementation, all function arguments are included in the JSON schema when list_tools is called, which prompts the LLM to provide values for all arguments when calling the tool. This can be limiting in scenarios where some arguments are intended to be provided by the client at execution time rather than being part of the LLM’s input. For example, if a tool requires a customer ID or session token the LLM should not be prompted to provide these values.

This solves #375

How Has This Been Tested?

Unit tests have been added to verify the changes are working.

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@martina-zxy martina-zxy changed the title Add client_provided_arg_model to FuncMetadata Allow function argument to be excluded from the tool's JSON schema Apr 25, 2025
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.

1 participant