Skip to main content
Glama
njlnaet
by njlnaet

Get CoderSwap Job Status

coderswap_get_job_status

Check the status of a research ingestion job by providing the job ID to monitor progress and completion.

Instructions

Check the status of a research ingestion job

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes
job_idYes
failed_countNo
crawled_countNo

Implementation Reference

  • src/index.ts:428-483 (registration)
    Registration of the 'coderswap_get_job_status' tool, including input/output schemas and the handler function.
    server.registerTool(
      'coderswap_get_job_status',
      {
        title: 'Get CoderSwap Job Status',
        description: 'Check the status of a research ingestion job',
        inputSchema: {
          job_id: z.string().min(1, 'job_id is required')
        },
        outputSchema: {
          job_id: z.string(),
          state: z.string(),
          crawled_count: z.number().optional(),
          failed_count: z.number().optional()
        }
      },
      async ({ job_id }) => {
        try {
          log('debug', 'Checking job status', { job_id })
          const job = await client.getJobStatus(job_id)
    
          const output = {
            job_id: job.job_id,
            state: job.state,
            crawled_count: job.crawled_count,
            failed_count: job.failed_count
          }
    
          log('info', `Job ${job_id} status: ${job.state}`)
    
          let statusText = `Job: ${job_id}\nStatus: ${job.state}`
          if (job.crawled_count !== undefined) {
            statusText += `\nCrawled: ${job.crawled_count} documents`
          }
          if (job.failed_count !== undefined && job.failed_count > 0) {
            statusText += `\nFailed: ${job.failed_count} documents`
          }
    
          return {
            content: [{
              type: 'text',
              text: statusText
            }],
            structuredContent: output
          }
        } catch (error) {
          log('error', 'Failed to get job status', { job_id, error: error instanceof Error ? error.message : error })
          return {
            content: [{
              type: 'text',
              text: `✗ Failed to get job status: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          }
        }
      }
    )
  • The async handler function that executes the tool logic: fetches job status via client and formats response.
    async ({ job_id }) => {
      try {
        log('debug', 'Checking job status', { job_id })
        const job = await client.getJobStatus(job_id)
    
        const output = {
          job_id: job.job_id,
          state: job.state,
          crawled_count: job.crawled_count,
          failed_count: job.failed_count
        }
    
        log('info', `Job ${job_id} status: ${job.state}`)
    
        let statusText = `Job: ${job_id}\nStatus: ${job.state}`
        if (job.crawled_count !== undefined) {
          statusText += `\nCrawled: ${job.crawled_count} documents`
        }
        if (job.failed_count !== undefined && job.failed_count > 0) {
          statusText += `\nFailed: ${job.failed_count} documents`
        }
    
        return {
          content: [{
            type: 'text',
            text: statusText
          }],
          structuredContent: output
        }
      } catch (error) {
        log('error', 'Failed to get job status', { job_id, error: error instanceof Error ? error.message : error })
        return {
          content: [{
            type: 'text',
            text: `✗ Failed to get job status: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        }
      }
    }
  • CoderSwapClient.getJobStatus method that makes the API request to retrieve the job status from the backend.
    async getJobStatus(jobId: string): Promise<IngestJobStatus> {
      const res = await fetch(`${this.baseUrl}/research/jobs/${jobId}`, {
        headers: this.headers
      })
      const data = await this.handleResponse<{ job: IngestJobStatus }>(res)
      return data.job
    }
  • Zod schema for job status input (job_id), defined in types.ts (matches inline schema).
    export const jobStatusSchema = z.object({
      job_id: z.string().min(1)
    })
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'check' operation, which implies read-only behavior, but doesn't confirm if it's safe, idempotent, or has side effects. It lacks details on authentication needs, rate limits, error conditions, or what the status check entails (e.g., polling, immediate response). The description adds minimal behavioral context beyond the basic action.

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 front-loads the core purpose without unnecessary words. It avoids redundancy with the tool name and title, and every part of the sentence contributes directly to understanding the tool's function. No fluff or wasted space is present.

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 (1 parameter) and the presence of an output schema (which likely defines status values), the description is minimally adequate. However, with no annotations and incomplete parameter semantics, it leaves gaps in understanding behavioral traits and usage context. It meets basic needs but doesn't fully compensate for the lack of structured metadata.

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 input schema has 1 parameter with 0% description coverage, so the schema provides no semantic information. The description doesn't mention the 'job_id' parameter at all, failing to explain what it is, where to get it, or its format. However, with only one parameter, the baseline is higher; the tool's purpose inherently implies a job identifier is needed, but explicit parameter guidance is missing.

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 ('Check') and resource ('status of a research ingestion job'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'coderswap_research_ingest' (which likely creates jobs) and 'coderswap_get_project_stats' (which focuses on projects rather than jobs). However, it doesn't specify what a 'research ingestion job' entails or what status values might be returned.

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. It doesn't mention prerequisites (e.g., needing a job ID from a previous operation), exclusions, or relationships to siblings like 'coderswap_research_ingest' (which might create the jobs being checked). Usage is implied only through the tool name and description context.

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/njlnaet/mcp-server'

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