get_subagent_results
Retrieve task outcomes from autonomous AI subagents using session ID, enabling efficient monitoring of parallel and sequential task execution across specialized development roles.
Instructions
Get results from completed subagents
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session ID to get results for |
Implementation Reference
- src/index.js:390-414 (handler)The main execution logic for the 'get_subagent_results' tool. It fetches the session data from the activeSubagents Map using the provided session_id, checks if it exists, and returns a formatted text response with session details, output, status, and any errors.async getSubagentResults(args) { const { session_id } = args; if (!this.activeSubagents.has(session_id)) { throw new McpError( ErrorCode.InvalidRequest, `Session ${session_id} not found` ); } const session = this.activeSubagents.get(session_id); return { content: [ { type: 'text', text: `Subagent Session Results\n\nSession ID: ${session_id}\nTask: ${session.task}\nStatus: ${session.status}\nExecution Mode: ${session.execution_mode}\nAgents: ${session.agents.length}\n\n` + `Start Time: ${session.startTime}\n` + `End Time: ${session.endTime || 'Still running'}\n\n` + `Output:\n${session.output || 'No output yet'}\n\n` + `${session.error ? `Errors:\n${session.error}` : ''}` } ] }; }
- src/index.js:129-138 (schema)Input schema definition for the tool, specifying that a 'session_id' string is required.inputSchema: { type: 'object', properties: { session_id: { type: 'string', description: 'Session ID to get results for' } }, required: ['session_id'] }
- src/index.js:155-156 (registration)Tool dispatch registration in the CallToolRequestSchema handler's switch statement, mapping the tool name to its handler function.case 'get_subagent_results': return await this.getSubagentResults(args);
- src/index.js:126-139 (registration)Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.{ name: 'get_subagent_results', description: 'Get results from completed subagents', inputSchema: { type: 'object', properties: { session_id: { type: 'string', description: 'Session ID to get results for' } }, required: ['session_id'] } }