[exec] Add MCP tool arguments and results (#5899)

Extends mcp_tool_call item to include arguments and results.
This commit is contained in:
pakrym-oai
2025-10-29 14:23:57 -07:00
committed by GitHub
parent 13e1d0362d
commit 815ae4164a
7 changed files with 784 additions and 39 deletions

View File

@@ -45,6 +45,7 @@
"prepare": "pnpm run build"
},
"devDependencies": {
"@modelcontextprotocol/sdk": "^1.20.2",
"@types/jest": "^29.5.14",
"@types/node": "^20.19.18",
"eslint": "^9.36.0",

View File

@@ -1,5 +1,7 @@
// based on item types from codex-rs/exec/src/exec_events.rs
import type { ContentBlock as McpContentBlock } from "@modelcontextprotocol/sdk/types.js";
/** The status of a command execution. */
export type CommandExecutionStatus = "in_progress" | "completed" | "failed";
@@ -53,6 +55,17 @@ export type McpToolCallItem = {
server: string;
/** The tool invoked on the MCP server. */
tool: string;
/** Arguments forwarded to the tool invocation. */
arguments: unknown;
/** Result payload returned by the MCP server for successful calls. */
result?: {
content: McpContentBlock[];
structured_content: unknown;
};
/** Error message reported for failed calls. */
error?: {
message: string;
};
/** Current status of the tool invocation. */
status: McpToolCallStatus;
};