Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix #23 Add Hosted MCP server tool support #33

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

Merged
merged 9 commits into from
Jun 11, 2025
Merged

Conversation

seratch
Copy link
Member

@seratch seratch commented Jun 6, 2025

This pull request resolves #23

Copy link

changeset-bot bot commented Jun 6, 2025

🦋 Changeset detected

Latest commit: 9779f1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-openai Patch
@openai/agents-core Patch
@openai/agents Patch
@openai/agents-realtime Patch
@openai/agents-extensions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

const mcpServerLabel = providerData.serverLabel;
const mcpServerTool = mcpToolMap.get(mcpServerLabel);
if (mcpServerTool !== undefined) {
const toolName = JSON.stringify({
Copy link
Member Author

Choose a reason for hiding this comment

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

Having both server label and tool name is helpful for MCP server usage, so I've included both in JSON format.

@seratch seratch force-pushed the issue-23-hosted-mcp-tool branch from 0ec80e0 to 4ea61dc Compare June 10, 2025 06:29
@seratch
Copy link
Member Author

seratch commented Jun 10, 2025

@dkundel-openai Updated this PR based on the previous review comments. It should be ready for review again

@seratch seratch force-pushed the issue-23-hosted-mcp-tool branch from 5239872 to 20c708c Compare June 10, 2025 21:39
@seratch seratch force-pushed the issue-23-hosted-mcp-tool branch from 7fcef85 to 9779f1c Compare June 11, 2025 04:01
@@ -88,7 +88,7 @@ describe('Runner.run', () => {

const rawItem = {
name: 'toolZ',
call_id: 'c1',
callId: 'c1',
Copy link
Collaborator

Choose a reason for hiding this comment

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

was this just broken or did this change somewhere? I didn't see the related change anywhere else

Copy link
Member Author

Choose a reason for hiding this comment

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

this is associated with this change. i don't have any strong opinion about the additional validation but it should be good to go: https://github.com/openai/openai-agents-js/pull/33/files#r2139160148

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah this was actually broken. It's always been callId for a function_call but because in this test it was typed as any it didn't cause trouble

.filter(
(item) =>
item instanceof RunToolApprovalItem &&
'callId' in item.rawItem &&
Copy link
Member Author

Choose a reason for hiding this comment

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

@dkundel-openai this is the change that is not compatible with run.test.ts's call_id; do you think both callId and call_id should be supported? I don't think so though.

@seratch seratch merged commit 2fae25c into main Jun 11, 2025
5 checks passed
@seratch seratch deleted the issue-23-hosted-mcp-tool branch June 11, 2025 05:49
@seratch seratch added the enhancement New feature or request label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Hosted MCP server tool support
2 participants