check_response_status
Monitor the progress of AI-generated response tasks to track completion status and retrieve results when ready.
Instructions
Check the status of a response generation task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | The task ID returned by generate_response |
Implementation Reference
- src/index.ts:327-357 (handler)Handler for 'check_response_status' tool: validates input, retrieves task status from activeTasks Map, and returns formatted status JSON.} else if (request.params.name === 'check_response_status') { if (!isValidCheckResponseStatusArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid check_response_status arguments' ); } const taskId = request.params.arguments.taskId; const task = this.activeTasks.get(taskId); if (!task) { throw new McpError( ErrorCode.InvalidRequest, `No task found with ID: ${taskId}` ); } return { content: [ { type: 'text', text: JSON.stringify({ status: task.status, reasoning: task.showReasoning ? task.reasoning : undefined, response: task.status === 'complete' ? task.response : undefined, error: task.error }) } ] };
- src/index.ts:271-284 (registration)Registration of the 'check_response_status' tool in the ListTools handler, including name, description, and input schema.{ name: 'check_response_status', description: 'Check the status of a response generation task', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'The task ID returned by generate_response' } }, required: ['taskId'] } }
- src/index.ts:52-54 (schema)TypeScript interface defining the expected input shape for check_response_status arguments.interface CheckResponseStatusArgs { taskId: string; }
- src/index.ts:66-69 (schema)Runtime validator function for CheckResponseStatusArgs type.const isValidCheckResponseStatusArgs = (args: any): args is CheckResponseStatusArgs => typeof args === 'object' && args !== null && typeof args.taskId === 'string';
- src/index.ts:56-64 (helper)Interface defining the structure of task status objects stored in activeTasks Map, used by the handler.interface TaskStatus { status: 'pending' | 'reasoning' | 'responding' | 'complete' | 'error'; prompt: string; showReasoning?: boolean; reasoning?: string; response?: string; error?: string; timestamp: number; }