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}`
              }
            ]
          };
        }
      }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide a title ('Get Job Type Configuration') but no explicit hints like readOnlyHint or destructiveHint. The description adds minimal behavioral context by implying a read operation ('Retrieves'), but it doesn't disclose details such as authentication needs, rate limits, or error handling, leaving gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded and appropriately sized, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no output schema, simple schema), the description is minimally adequate. It covers the basic purpose but lacks details on output format, error cases, or integration with siblings, making it incomplete for fully informed usage without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('job_type_id', 'org_id') well-documented in the schema. The description adds no additional meaning beyond the schema, such as explaining parameter interactions or usage nuances, so it meets the baseline for high coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieves') and resource ('an agent job type by its ID'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_job' or 'list_jobs', which might retrieve different job-related data, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'get_job' or 'list_jobs'. It lacks context on prerequisites, exclusions, or specific scenarios, offering only a basic statement of function without usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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