Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
job_type_idYesThe unique identifier of the job type you want to retrieve. Example: 'mood-monitor'.
org_idNoThe organization ID. Example: 'aiconnect'.

Implementation Reference

  • 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}` } ] }; } }
  • 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() } },
  • 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}` } ] }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aiconnect-cloud/agentjobs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server