Skip to content

Conversation

maeryo
Copy link

@maeryo maeryo commented Sep 24, 2025

According to https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta, the _meta parameter should be passable when calling tools. While the CallToolRequest class (in types.kt) currently includes _meta in its definition, SDK users cannot actually input _meta when invoking the callTool method.

This Pull Request adds a metadata parameter to the CallTool method and includes functionality to convert various data formats without loss.

Additionally, to encourage the use of valid Key name formats as defined by the protocol, validation for prefixes has been implemented.

Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @maeryo
PR should always come with a test.
Let's revisit it after #294 is merged, so we have all the models coming

@kpavlov kpavlov added the question Further information is requested label Sep 29, 2025
@maeryo
Copy link
Author

maeryo commented Sep 29, 2025

Thank you for your feedback, @kpavlov
I've committed the test code.
Is there anything else I should check?

@kpavlov
Copy link
Contributor

kpavlov commented Sep 29, 2025

Thank you, @maeryo
Mock transport is very valuable. Let's double-check that it is thread-safe and can be used for parallel tests, and extract it to separate file.
Please also run ktlint fix, because ette build is failing because of this

- Add meta parameter support to callTool method with validation
- Implement MCP-compliant meta key validation (reserved prefixes, format rules)
- Enhance JSON conversion for complex data types with better error handling
- Add comprehensive test suite for meta parameter functionality
- Improve MockTransport to simulate proper initialization flow
- Update API signatures to include meta parameter support
@maeryo
Copy link
Author

maeryo commented Sep 29, 2025

@kpavlov, I just fixed ktlint. 🚀
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants