Skip to main content
Glama

get_job_type

Retrieve agent job type details using its unique identifier, enabling efficient management and querying of asynchronous jobs within the AI Connect platform.

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

  • The core handler function for the 'get_job_type' tool. It extracts job_type_id and optional org_id from params, constructs an API endpoint, calls agentJobsClient.get to fetch the job type data, formats it using formatJobTypeDetails, and returns a text content response. Handles errors by returning an error message.
    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}` } ] }; } }
  • The input schema for the 'get_job_type' tool, validated using Zod. Requires job_type_id (string) and optional org_id (string). Provides descriptions and examples.
    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() }
  • The registration of the 'get_job_type' tool on the MCP server, including name, description, annotations, inputSchema, and the 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}` } ] }; } } );

Other Tools

Related Tools

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