Skip to content
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

Support object type tool result #156

Open
logan272 opened this issue Feb 21, 2025 · 0 comments
Open

Support object type tool result #156

logan272 opened this issue Feb 21, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@logan272
Copy link

Is your feature request related to a problem? Please describe.
Currently, the Tool Result can only return Text Content, Image Content, or Embedded Resources. However, there are many instances where I need the tool call to return a JSON object.

Describe the solution you'd like
I propose adding an object content type to the tool result, allowing for structured data to be returned directly. For example:

return {
   content: [
      {
           type: 'object',
           data: { ... }
      }
   ]
}

Describe alternatives you've considered
Currently, when I want to return structured data from a tool call, I have to use the following workaround, which is not ideal:

return {
   content: [
      {
           type: 'text',
           text: JSON.stringify(data)
      }
   ]
}
@logan272 logan272 added the enhancement New feature or request label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant