describeMediaJob
Retrieve details of a media intelligent cover task by specifying the job ID using the MCP server, enabling query and management of task results on Tencent Cloud COS without coding.
Instructions
根据 jobid 查询指定的媒体智能封面任务结果
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | 要查询的任务ID,可通过提交智能封面任务的响应中获取。 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"jobId": {
"description": "要查询的任务ID,可通过提交智能封面任务的响应中获取。",
"type": "string"
}
},
"required": [
"jobId"
],
"type": "object"
}
Implementation Reference
- src/services/ci/media.service.ts:138-176 (handler)Core implementation of describeMediaJob: sends GET request to Tencent Cloud COS CI API endpoint to retrieve the status and details of the specified media job.async describeMediaJob(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: '智能封面任务查询成功', data: result, }; } catch (error) { return { isSuccess: false, message: '智能封面任务查询失败', data: error, }; } }
- src/server.ts:470-474 (schema)Input schema for describeMediaJob tool: requires jobId as a string.{ jobId: z .string() .describe('要查询的任务ID,可通过提交智能封面任务的响应中获取。'), },
- src/server.ts:467-487 (registration)MCP server.tool registration for 'describeMediaJob', including description, input schema, and thin handler that delegates to CIMediaService.describeMediaJob and formats response.server.tool( 'describeMediaJob', '根据 jobid 查询指定的媒体智能封面任务结果', { jobId: z .string() .describe('要查询的任务ID,可通过提交智能封面任务的响应中获取。'), }, async ({ jobId }) => { const res = await CIMediaInstance.describeMediaJob(jobId); return { content: [ { type: 'text', text: JSON.stringify(res.data, null, 2), }, ], isError: !res.isSuccess, }; }, );