Skip to content

feat(server): add utility functions for CallToolResult #73

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 4 commits into
base: main
Choose a base branch
from

Conversation

Stream29
Copy link

Motivation and Context

I add two function in types.util.kt : CallToolResult.Companion.ok and CallToolResult.Companion.error.

I found it being a boilerplate code when writing CallToolResult(listOf(TextContent(content))). So I think it's necessary to add a short hand for constructing CallToolResult.

My solution is : CallToolResult.ok(...) and CallToolResult.error(...).

I added these two functions with document.

How Has This Been Tested?

It's just a wrapper of the constructor of CallToolResult, so I think no test needed after viewing the code.

Breaking Changes

This is not a breaking change.

Types of changes

  • [+ ] New feature (non-breaking change which adds functionality)

CallToolResult.Companion.ok and CallToolResult.Companion.error
@Stream29
Copy link
Author

@Mr3zee Could you take a look at my PR? Merge it, close it, or tell me what to do.

Copy link
Contributor

@e5l e5l left a comment

Choose a reason for hiding this comment

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

hey @Stream29, thanks for the PR. LGTM.
Could you add tests and update API dump so I can merge?

@Stream29
Copy link
Author

OK. I'll be working on it quickly.

@Stream29 Stream29 requested a review from e5l April 26, 2025 12:54
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