describeDocProcessJob
Retrieve the status and results of a specific document transcoding task using its job ID. Enables easy tracking and management of document processing operations on Tencent Cloud COS MCP Server.
Instructions
根据 jobid 查询指定的文档转码任务结果
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | 要查询的任务ID,可通过提交文档任务的响应中获取。 |
Implementation Reference
- src/services/ci/doc.service.ts:144-182 (handler)Core handler function implementing the logic to query Tencent Cloud COS for the document processing job status using the provided jobId.async describeDocProcessJob(jobId: string) { try { let host = this.bucket + '.ci.' + this.region + '.myqcloud.com'; let url = 'https://' + host + '/doc_jobs/' + jobId; const result = await new Promise((resolve, reject) => { this.cos.request( { Bucket: this.bucket, // Bucket 格式:test-1250000000 Region: this.region, Method: 'GET', Key: 'doc_jobs/' + jobId, Url: url, }, function (error, data) { if (error) { // 处理请求失败 reject(error); } else { // 处理请求成功 resolve(data); //获取返回的jobid, 去调查询任务接口, 返回具体信息 } }, ); }); return { isSuccess: true, message: '文档转pdf成功', data: result, }; } catch (error) { return { isSuccess: false, message: '文档转pdf失败', data: error, }; } }
- src/server.ts:551-571 (registration)MCP server tool registration, defining the tool name, description, input schema (jobId as string), and handler that delegates to the service instance.server.tool( 'describeDocProcessJob', '根据 jobid 查询指定的文档转码任务结果', { jobId: z .string() .describe('要查询的任务ID,可通过提交文档任务的响应中获取。'), }, async ({ jobId }) => { const res = await CIDocInstance.describeDocProcessJob(jobId); return { content: [ { type: 'text', text: JSON.stringify(res.data, null, 2), }, ], isError: !res.isSuccess, }; }, );
- src/server.ts:555-558 (schema)Zod input schema validation for the jobId parameter.jobId: z .string() .describe('要查询的任务ID,可通过提交文档任务的响应中获取。'), },