Skip to main content
Glama
RichFerry

Production MCP Template

by RichFerry

jobs_get_status

Read-onlyIdempotent

Retrieve the status of a specific background job by its ID. Use this to check if a job completed, failed, or is still running.

Instructions

Fetch a specific background job status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes

Implementation Reference

  • The tool handler function 'jobs_get_status' — registered as an MCP tool on the FastMCP server. Takes a job_id string, fetches status via the JobService, wraps KeyError as ValueError.
    @server.tool(
        name="jobs_get_status",
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True, openWorldHint=False),
    )
    async def jobs_get_status(job_id: str) -> object:
        """Fetch a specific background job status."""
        with container.metrics.observe_tool("jobs_get_status"):
            try:
                return await container.jobs.get_status(job_id)
            except KeyError as exc:
                raise ValueError(str(exc)) from exc
  • The JobStatus Pydantic model returned by the handler — defines fields like id, status, progress, result, error.
    class JobStatus(TemplateModel):
        id: str
        name: str
        status: Literal["queued", "running", "succeeded", "failed"]
        submitted_at: datetime
        started_at: datetime | None = None
        completed_at: datetime | None = None
        progress: float = 0.0
        metadata: dict[str, Any] = Field(default_factory=dict)
        result: dict[str, Any] | None = None
        error: str | None = None
  • The JobService.get_status helper method that the handler delegates to — retrieves a deep copy of the JobStatus from the in-memory dict under an async lock.
    async def get_status(self, job_id: str) -> JobStatus:
        async with self._lock:
            try:
                return self._jobs[job_id].model_copy(deep=True)
            except KeyError as exc:
                raise KeyError(f"Unknown job: {job_id}") from exc
  • ModuleDescriptor returned by the register() function declaring the tool name 'jobs_get_status' in the tools list.
    return ModuleDescriptor(
        name="jobs",
        title="Jobs",
        summary="Long-running task scaffolding and status resources for orchestration-heavy servers.",
        tags=["background", "async", "orchestration"],
        maturity="beta",
        tools=["jobs_submit_blueprint", "jobs_get_status", "jobs_list"],
        resources=["job://{job_id}"],
        prompts=["jobs_postmortem"],
    )
Behavior3/5

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

Annotations already provide readOnlyHint and idempotentHint. Description adds no behavioral traits beyond the obvious read operation. No contradiction.

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?

Single sentence with no wasted words. Front-loaded with verb and resource.

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?

For a simple fetch tool with one param and no output schema, the description is adequate but lacks return value expectations or any additional context about status values.

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

Parameters2/5

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

Schema coverage is 0%, so description must compensate. It only implies job_id is the identifier without adding syntax, format, or source context. Insufficient for a single critical parameter.

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?

Description clearly states the verb 'Fetch' and resource 'specific background job status'. It distinguishes from sibling 'jobs_list' which likely lists multiple jobs.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives like 'jobs_list'. Implied use for a single job status check, but lacks when-not-to-use or prerequisite info.

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/RichFerry/MCP-Template'

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