get_job_type
Retrieve agent job type details by ID to understand job specifications and requirements in the Agent Jobs system.
Instructions
Retrieves an agent job type by its ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_type_id | Yes | The unique identifier of the job type you want to retrieve. Example: 'mood-monitor'. | |
| org_id | No | The organization ID. Example: 'aiconnect'. |
Implementation Reference
- src/tools/get_job_type.ts:26-83 (handler)Handler function that processes the tool call: extracts parameters, calls the agentJobsClient API to fetch job type data, formats it using formatJobTypeDetails, logs with mcpDebugger, and returns formatted text response or error.
async (params) => { mcpDebugger.toolCall("get_job_type", params); const { job_type_id } = params; const org_id = params.org_id || config.DEFAULT_ORG_ID; const endpoint = `/organizations/${org_id}/agent-jobs-type/${job_type_id}`; mcpDebugger.debug("Job type request", { endpoint, job_type_id, org_id, usingDefaultOrg: !params.org_id }); try { const response = await withTiming( () => agentJobsClient.get(endpoint), "get_job_type API call" ); mcpDebugger.debug("Job type raw response", { response }); // The API returns { data: {...}, meta: {...} } but agentJobsClient should extract data // However, let's be defensive and handle both cases const jobTypeData = response?.data ? response.data : response; mcpDebugger.debug("Job type extracted data", { jobTypeData }); const result = { content: [ { type: 'text' as const, text: formatJobTypeDetails(jobTypeData) } ] }; mcpDebugger.toolResponse("get_job_type", { job_type_id, org_id, resultLength: result.content[0].text.length, hasData: !!jobTypeData }); return result; } catch (error: any) { mcpDebugger.toolError("get_job_type", error); return { content: [ { type: 'text' as const, text: `Error getting job type: ${error.message}` } ] }; } } - src/tools/get_job_type.ts:11-25 (schema)Input schema definition using Zod for the 'get_job_type' tool, requiring job_type_id (string) and optional org_id (string).
{ description: 'Retrieves an agent job type by its ID.', annotations: { title: 'Get Job Type Configuration' }, inputSchema: { job_type_id: z.string({ description: "The unique identifier of the job type you want to retrieve. Example: 'mood-monitor'." }), org_id: z.string({ description: "The organization ID. Example: 'aiconnect'." }).optional() } }, - src/tools/get_job_type.ts:9-84 (registration)Registers the 'get_job_type' tool with the MCP server, providing description, annotations, input schema, and handler function.
server.registerTool( 'get_job_type', { description: 'Retrieves an agent job type by its ID.', annotations: { title: 'Get Job Type Configuration' }, inputSchema: { job_type_id: z.string({ description: "The unique identifier of the job type you want to retrieve. Example: 'mood-monitor'." }), org_id: z.string({ description: "The organization ID. Example: 'aiconnect'." }).optional() } }, async (params) => { mcpDebugger.toolCall("get_job_type", params); const { job_type_id } = params; const org_id = params.org_id || config.DEFAULT_ORG_ID; const endpoint = `/organizations/${org_id}/agent-jobs-type/${job_type_id}`; mcpDebugger.debug("Job type request", { endpoint, job_type_id, org_id, usingDefaultOrg: !params.org_id }); try { const response = await withTiming( () => agentJobsClient.get(endpoint), "get_job_type API call" ); mcpDebugger.debug("Job type raw response", { response }); // The API returns { data: {...}, meta: {...} } but agentJobsClient should extract data // However, let's be defensive and handle both cases const jobTypeData = response?.data ? response.data : response; mcpDebugger.debug("Job type extracted data", { jobTypeData }); const result = { content: [ { type: 'text' as const, text: formatJobTypeDetails(jobTypeData) } ] }; mcpDebugger.toolResponse("get_job_type", { job_type_id, org_id, resultLength: result.content[0].text.length, hasData: !!jobTypeData }); return result; } catch (error: any) { mcpDebugger.toolError("get_job_type", error); return { content: [ { type: 'text' as const, text: `Error getting job type: ${error.message}` } ] }; } } );