Skip to content

Conversation

@jclyne
Copy link
Contributor

@jclyne jclyne commented Oct 23, 2025

Motivation and Context

The recently released openAI Apps SDK adds a '_meta' field on the Tool Descriptor. This would be in addition to it being available on Messages. It remains optional and defaults to an empty json object, following existing conventions.

This also adds a Tool.Builder and Tool.build() builders to help with Tool's large constructor

How Has This Been Tested?

Unit tests for serialization added

Breaking Changes

N/A

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

https://developers.openai.com/apps-sdk
https://developers.openai.com/apps-sdk/reference/#_meta-fields-the-client-provides

@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 19:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an optional _meta field to the Tool class to align with the OpenAI Apps SDK specification, which includes metadata fields on Tool descriptors. The change maintains backward compatibility by defaulting to an empty JSON object.

  • Adds _meta field to Tool data class by implementing the WithMeta interface
  • Updates Server.addTool() method to accept an optional _meta parameter
  • Adds comprehensive serialization tests for the new field

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.kt Adds _meta field to Tool class and implements WithMeta interface
kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/Server.kt Updates addTool() method to accept optional _meta parameter
kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/ToolSerializationTest.kt Adds test coverage for _meta field serialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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, Jeff

kpavlov
kpavlov previously approved these changes Oct 23, 2025
@jclyne jclyne requested a review from kpavlov October 23, 2025 21:47
andrewjenkins added a commit to cashapp/misk that referenced this pull request Oct 23, 2025
Adds support for tool descriptor metadata to misk-mcp. This is required by then OpenAI Apps SDK: https://developers.openai.com/apps-sdk/reference

This is a temporary solution until modelcontextprotocol/kotlin-sdk#339 can be pulled in.
@jclyne
Copy link
Contributor Author

jclyne commented Oct 24, 2025

Thank you, Jeff

My pleasure @kpavlov, looking forward to this merge

@kpavlov kpavlov requested a review from devcrocod October 25, 2025 08:43
@maeryo
Copy link
Contributor

maeryo commented Oct 26, 2025

#289
Please refer to the recently merged PR.

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.

3 participants