Skip to main content
Glama

get_job

Get the current state of a public Job: status, budget, transactions, evaluation outcome. No authentication required.

Instructions

Get the current state of a Job (status, budget, transactions, evaluation outcome). No authentication required — Job state is public.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYesJob ID (job_...)

Implementation Reference

  • src/index.ts:305-320 (registration)
    Registration of the 'get_job' tool using server.tool() on the MCP server, with description and schema.
    server.tool(
      "get_job",
      "Get the current state of a Job (status, budget, transactions, evaluation outcome). No authentication required — Job state is public.",
      {
        jobId: z.string().describe("Job ID (job_...)"),
      },
      async ({ jobId }) => {
        try {
          const res = await callApi("GET", `/jobs/${jobId}`, undefined, false);
          if (!res.ok) return errorResponse("Get job failed", res);
          return successResponse(res.json);
        } catch (e) {
          return { content: [{ type: "text" as const, text: `Get job error: ${e}` }], isError: true };
        }
      },
    );
  • Input schema requiring a single 'jobId' string parameter validated by Zod (z.string()).
    {
      jobId: z.string().describe("Job ID (job_...)"),
    },
  • Handler function that calls the API GET /jobs/{jobId} (no auth), returns formatted success/error response.
    async ({ jobId }) => {
      try {
        const res = await callApi("GET", `/jobs/${jobId}`, undefined, false);
        if (!res.ok) return errorResponse("Get job failed", res);
        return successResponse(res.json);
      } catch (e) {
        return { content: [{ type: "text" as const, text: `Get job error: ${e}` }], isError: true };
      }
    },
  • callApi helper used by the handler to make HTTP requests to the CardZero API.
    async function callApi(
      method: "GET" | "POST",
      path: string,
      body?: Record<string, unknown>,
      auth = true,
    ): Promise<ApiResult> {
      if (auth && !API_KEY) {
        return {
          ok: false,
          status: 401,
          json: {
            error: "config_missing",
            message: "CARDZERO_API_KEY is not set. Get one at https://cardzero.ai",
          },
        };
      }
    
      const headers: Record<string, string> = {};
      if (auth) headers["Authorization"] = `Bearer ${API_KEY}`;
      if (body) headers["Content-Type"] = "application/json";
    
      const res = await fetch(`${API_URL}${path}`, {
        method,
        headers,
        body: body ? JSON.stringify(body) : undefined,
      });
    
      const json = await res.json() as Record<string, unknown>;
      return { ok: res.ok, status: res.status, json };
    }
  • successResponse and errorResponse helper functions used to format tool output.
    function errorResponse(label: string, result: ApiResult) {
      const code = result.json.error || result.status;
      const msg = result.json.message || "Unknown error";
      return {
        content: [{ type: "text" as const, text: `${label}: [${code}] ${msg}` }],
        isError: true,
      };
    }
    
    function successResponse(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior4/5

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

With no annotations provided, the description fully carries the burden. It discloses that the operation is read-only and publicly accessible, which are key behavioral traits. However, it does not specify error handling or rate limits.

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 two sentences front-loading the core purpose and adding a critical access note. Every sentence adds value with no redundancy.

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

Completeness5/5

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

The tool is simple with one parameter and no output schema. The description adequately covers what is returned and access requirements, meeting completeness needs.

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% for the single parameter 'jobId', which is described as 'Job ID (job_...)'. The description adds no further meaning beyond the schema, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool retrieves the current state of a Job, listing specific fields (status, budget, transactions, evaluation outcome). This distinctively separates it from sibling tools like create_job (creation) and fund_job (funding).

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

Usage Guidelines4/5

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

It explicitly states no authentication is required and the job state is public, giving clear context for when to use. However, it does not explicitly mention when not to use or name alternative tools.

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/mrocker/cardzero-mcp'

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