Skip to main content
Glama

job_status

Check the status of async web data jobs like crawls using the job ID. Monitor progress and completion for data gathering tasks.

Instructions

Check the status of an async job (e.g. crawl). Costs 0 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesJob ID returned by crawl or other async endpoints

Implementation Reference

  • The handler for the 'job_status' tool. It takes a job_id parameter and fetches the job status via apiGet, returning the result as JSON content.
    server.tool(
      "job_status",
      "Check the status of an async job (e.g. crawl). Costs 0 credits.",
      { job_id: z.string().describe("Job ID returned by crawl or other async endpoints") },
      async ({ job_id }) => jsonResult(await apiGet(`/jobs/${job_id}`))
    );
  • Input schema for 'job_status' tool using Zod: defines job_id as a required string parameter with a description.
    { job_id: z.string().describe("Job ID returned by crawl or other async endpoints") },
  • src/index.ts:159-164 (registration)
    Registration of the 'job_status' tool with the MCP server, including name, description, schema, and handler function.
    server.tool(
      "job_status",
      "Check the status of an async job (e.g. crawl). Costs 0 credits.",
      { job_id: z.string().describe("Job ID returned by crawl or other async endpoints") },
      async ({ job_id }) => jsonResult(await apiGet(`/jobs/${job_id}`))
    );
  • Helper function apiGet that performs HTTP GET requests to the SearchClaw API with timeout handling and error management.
    async function apiGet(path: string, params?: Record<string, string>) {
      const url = new URL(`${API_BASE}${path}`);
      if (params) {
        for (const [key, value] of Object.entries(params)) {
          url.searchParams.set(key, value);
        }
      }
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 30000);
      try {
        const response = await fetch(url.toString(), { headers, signal: controller.signal });
        if (!response.ok) {
          const text = await response.text();
          throw new Error(`SearchClaw API error ${response.status}: ${text}`);
        }
        return response.json();
      } finally {
        clearTimeout(timeout);
      }
    }
  • Helper function jsonResult that formats API responses as MCP text content with JSON serialization.
    function jsonResult(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }

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/CSteenkamp/searchclaw-mcp'

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