diff --git a/.changeset/angry-peas-study.md b/.changeset/angry-peas-study.md new file mode 100644 index 00000000..732e649f --- /dev/null +++ b/.changeset/angry-peas-study.md @@ -0,0 +1,5 @@ +--- +'containers-mcp': patch +--- + +fix: use blob field for binary resources to prevent context overflow (#252) diff --git a/apps/sandbox-container/server/containerMcp.ts b/apps/sandbox-container/server/containerMcp.ts index ecbf9900..71e1a29a 100644 --- a/apps/sandbox-container/server/containerMcp.ts +++ b/apps/sandbox-container/server/containerMcp.ts @@ -165,10 +165,9 @@ export class ContainerMcpAgent extends McpAgent { { type: 'resource', resource: { - ...(readFile.type === 'text' + ...(readFile.type === 'text' ? { text: readFile.textOutput } - : { blob: readFile.base64Output } - ), + : { blob: readFile.base64Output }), uri: `file://${path}`, mimeType: readFile.mimeType, },