Skip to content

Commit 0d0dea2

Browse files
committed
fix: address PR feedback - change to patch version and fix backward compatibility
- Change changeset from minor to patch per @seratch feedback - Fix hardcoded 'Error running tool.' fallback that broke backward compatibility - Now returns result.content (empty array) when no content, preserving original behavior - Addresses feedback from #471 (review)
1 parent 0864c8a commit 0d0dea2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.changeset/mcp-structured-content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'@openai/agents-core': minor
2+
'@openai/agents-core': patch
33
---
44

55
feat(mcp): add structuredContent support behind `useStructuredContent`; return full CallToolResult from `callTool`

packages/agents-core/src/mcp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,8 @@ export function mcpToFunctionTool(
493493
) {
494494
return (result as any).structuredContent;
495495
}
496-
return 'Error running tool.';
496+
// Preserve backward compatibility: return empty array when no content
497+
return result.content;
497498
}
498499

499500
const schema: JsonObjectSchema<any> = {

0 commit comments

Comments
 (0)