Skip to main content
Glama

get_job

Retrieve an agent job by its ID to check status, view details, or monitor progress in the Agent Jobs system.

Instructions

Retrieves an agent job by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe unique identifier of the job you want to retrieve. Example: 'job-12345'.
org_idNoThe organization ID. Example: 'aiconnect'.

Implementation Reference

  • The handler function that executes the 'get_job' tool logic: extracts job_id and optional org_id, constructs API endpoint, fetches job data via agentJobsClient, formats details with formatJobDetails, and returns formatted text content or error.
    async (params) => {
      mcpDebugger.toolCall("get_job", params);
    
      const { job_id } = params;
      const endpoint = `/services/agent-jobs/${job_id}${params.org_id ? `?org_id=${params.org_id}` : ''}`;
    
      mcpDebugger.debug("Built endpoint", { endpoint, job_id, org_id: params.org_id });
    
      try {
        const job = await withTiming(
          () => agentJobsClient.get(endpoint),
          "get_job API call"
        );
    
        mcpDebugger.debug("Raw API response", { job });
    
        const result = {
          content: [
            {
              type: 'text' as const,
              text: formatJobDetails(job)
            }
          ]
        };
    
        mcpDebugger.toolResponse("get_job", {
          jobId: job_id,
          resultLength: result.content[0].text.length
        });
    
        return result;
      } catch (error: any) {
        mcpDebugger.toolError("get_job", error);
    
        return {
          content: [
            {
              type: 'text' as const,
              text: `Error getting job: ${error.message}`
            }
          ]
        };
      }
  • Input schema for the 'get_job' tool using Zod: requires job_id (string), optional org_id (string), with descriptions.
    {
      description: 'Retrieves an agent job by its ID.',
      annotations: {
        title: 'Get Agent Job'
      },
      inputSchema: {
        job_id: z.string({
          description:
            "The unique identifier of the job you want to retrieve. Example: 'job-12345'."
        }),
        org_id: z
          .string({
            description: "The organization ID. Example: 'aiconnect'."
          })
          .optional()
      }
    },
  • Registration of the 'get_job' tool on the MCP server, including name, schema, and handler reference.
    server.registerTool(
      'get_job',
      {
        description: 'Retrieves an agent job by its ID.',
        annotations: {
          title: 'Get Agent Job'
        },
        inputSchema: {
          job_id: z.string({
            description:
              "The unique identifier of the job you want to retrieve. Example: 'job-12345'."
          }),
          org_id: z
            .string({
              description: "The organization ID. Example: 'aiconnect'."
            })
            .optional()
        }
      },
      async (params) => {
        mcpDebugger.toolCall("get_job", params);
    
        const { job_id } = params;
        const endpoint = `/services/agent-jobs/${job_id}${params.org_id ? `?org_id=${params.org_id}` : ''}`;
    
        mcpDebugger.debug("Built endpoint", { endpoint, job_id, org_id: params.org_id });
    
        try {
          const job = await withTiming(
            () => agentJobsClient.get(endpoint),
            "get_job API call"
          );
    
          mcpDebugger.debug("Raw API response", { job });
    
          const result = {
            content: [
              {
                type: 'text' as const,
                text: formatJobDetails(job)
              }
            ]
          };
    
          mcpDebugger.toolResponse("get_job", {
            jobId: job_id,
            resultLength: result.content[0].text.length
          });
    
          return result;
        } catch (error: any) {
          mcpDebugger.toolError("get_job", error);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error getting job: ${error.message}`
              }
            ]
          };
        }
      }
    );
Behavior3/5

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

The description adds minimal behavioral context beyond what annotations provide. Annotations include a title ('Get Agent Job') but no other hints like readOnly or destructive. The description implies a read operation ('retrieves'), which aligns with typical retrieval behavior, but doesn't disclose details such as error handling, authentication needs, or rate limits. No contradiction with annotations exists.

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 extremely concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. There is no wasted verbiage or unnecessary elaboration, making it efficient and easy to parse.

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 simplicity (a retrieval operation with 2 parameters and no output schema), the description is minimally adequate. It states what the tool does but lacks context on usage guidelines, behavioral details, or output format. With no annotations beyond title and no output schema, more completeness would be beneficial, but it meets a basic threshold for this low-complexity tool.

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?

The description doesn't add any parameter semantics beyond what the input schema provides. Schema description coverage is 100%, with clear descriptions for both 'job_id' and 'org_id', including examples. The description itself doesn't mention parameters, so it relies entirely on the schema, meeting the baseline score for high coverage.

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 verb ('retrieves') and resource ('an agent job by its ID'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_job_type' or 'list_jobs', which might retrieve similar job-related information but with different scopes or parameters.

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. For example, it doesn't mention that this is for retrieving a single job by ID, as opposed to 'list_jobs' for multiple jobs or 'get_job_type' for job metadata. There are no explicit when/when-not instructions or prerequisites stated.

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