summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/mcp-tool.ts
diff options
context:
space:
mode:
authorRichie Foreman <[email protected]>2025-08-17 12:43:21 -0400
committerGitHub <[email protected]>2025-08-17 16:43:21 +0000
commit2998f27f703282359f6389d1c2d8758fc6a14955 (patch)
treea7e3ff7f969c44e61ab27240cdd615e291b6deae /packages/core/src/tools/mcp-tool.ts
parentec1fa954d18ec9abab3ce669536dd24559a499f1 (diff)
chore(compiler): Enable strict property access TS compiler flag. (#6255)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/core/src/tools/mcp-tool.ts')
-rw-r--r--packages/core/src/tools/mcp-tool.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/core/src/tools/mcp-tool.ts b/packages/core/src/tools/mcp-tool.ts
index 88e89c85..64952dd1 100644
--- a/packages/core/src/tools/mcp-tool.ts
+++ b/packages/core/src/tools/mcp-tool.ts
@@ -271,7 +271,7 @@ function transformResourceLinkBlock(block: McpResourceLinkBlock): Part {
*/
function transformMcpContentToParts(sdkResponse: Part[]): Part[] {
const funcResponse = sdkResponse?.[0]?.functionResponse;
- const mcpContent = funcResponse?.response?.content as McpContentBlock[];
+ const mcpContent = funcResponse?.response?.['content'] as McpContentBlock[];
const toolName = funcResponse?.name || 'unknown tool';
if (!Array.isArray(mcpContent)) {
@@ -308,8 +308,9 @@ function transformMcpContentToParts(sdkResponse: Part[]): Part[] {
* @returns A formatted string representing the tool's output.
*/
function getStringifiedResultForDisplay(rawResponse: Part[]): string {
- const mcpContent = rawResponse?.[0]?.functionResponse?.response
- ?.content as McpContentBlock[];
+ const mcpContent = rawResponse?.[0]?.functionResponse?.response?.[
+ 'content'
+ ] as McpContentBlock[];
if (!Array.isArray(mcpContent)) {
return '```json\n' + JSON.stringify(rawResponse, null, 2) + '\n```';