// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { Metadata, asTextContentResult } from 'chunkr-ai-mcp/tools/types'; import { Tool } from '@modelcontextprotocol/sdk/types.js'; import Chunkr from 'chunkr-ai'; export const metadata: Metadata = { resource: 'tasks.extract', operation: 'read', tags: [], httpMethod: 'get', httpPath: '/tasks/{task_id}/extract', operationId: 'get_extract_task_route', }; export const tool: Tool = { name: 'get_tasks_extract', description: 'Retrieves the current state of an extract task.\n\nReturns task details such as processing status, configuration, output (when\navailable), file metadata, and timestamps.\n\nTypical uses:\n- Poll a task during processing\n- Retrieve the final output once processing is complete\n- Access task metadata and configuration', inputSchema: { type: 'object', properties: { task_id: { type: 'string', }, base64_urls: { type: 'boolean', description: 'Whether to return base64 encoded URLs. If false, the URLs will be returned as presigned URLs.', }, include_chunks: { type: 'boolean', description: 'Whether to include chunks in the output response', }, }, required: ['task_id'], }, annotations: { readOnlyHint: true, }, }; export const handler = async (client: Chunkr, args: Record | undefined) => { const { task_id, ...body } = args as any; return asTextContentResult(await client.tasks.extract.get(task_id, body)); }; export default { metadata, tool, handler };