Skip to main content
Glama
RichFerry

Production MCP Template

by RichFerry

jobs_list

Read-onlyIdempotent

Retrieve a list of recent background jobs with current status and results. Monitor job execution and outcomes with a configurable result limit.

Instructions

List recent background jobs with current status and results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The tool handler function for 'jobs_list'. Decorated with @server.tool(name='jobs_list'), annotated as readOnly and idempotent. Takes an optional limit parameter (default 20) and delegates to container.jobs.list_jobs().
    @server.tool(
        name="jobs_list",
        annotations=ToolAnnotations(readOnlyHint=True, idempotentHint=True, openWorldHint=False),
    )
    async def jobs_list(limit: int = 20) -> object:
        """List recent background jobs with current status and results."""
        with container.metrics.observe_tool("jobs_list"):
            return await container.jobs.list_jobs(limit=limit)
  • The actual implementation of list_jobs() on JobService. Acquires a lock, sorts job statuses by submission time (descending), limits results, and returns a JobList model.
    async def list_jobs(self, limit: int = 20) -> JobList:
        async with self._lock:
            items = sorted(self._jobs.values(), key=lambda item: item.submitted_at, reverse=True)[:limit]
            return JobList(items=[item.model_copy(deep=True) for item in items], total=len(self._jobs))
  • JobStatus and JobList model definitions used by the jobs_list tool. JobStatus holds id, name, status, timestamps, progress, metadata, result, error. JobList wraps a list of JobStatus items with a total count.
    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
    
    
    class JobSubmission(TemplateModel):
        job: JobStatus
        queue_depth: int
    
    
    class JobList(TemplateModel):
        items: list[JobStatus]
        total: int
  • Module registrars mapping that includes 'jobs' mapped to register_jobs, which registers the jobs_list tool on the MCP server.
    MODULE_REGISTRARS: dict[str, ModuleRegistrar] = {
        "system": register_system,
        "workspace": register_workspace,
        "jobs": register_jobs,
        "design": register_design,
    }
  • The ModuleDescriptor returned by the register() function, declaring 'jobs_list' in the tools list for the jobs module.
    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 declare readOnlyHint and idempotentHint, so safety is clear. Description adds that results include status and results and are recent, but lacks details like ordering or pagination. Adds some value beyond annotations.

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, front-loaded with verb, no unnecessary words. Efficiently conveys the core action.

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 low complexity (1 param, no output schema) and good annotations, the description is adequate for basic use. However, missing parameter documentation and no return structure details leave gaps.

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

Parameters1/5

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

Schema has one parameter (limit) with 0% description coverage, and the description does not mention it at all. The description fails to add any meaning to the parameter that the schema's type and default don't already provide.

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 tool lists recent background jobs with status and results, which is a specific verb+resource combination. It effectively distinguishes from siblings like jobs_get_status (single job) and jobs_submit_blueprint (submission).

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?

No guidance on when to use this tool versus alternatives. It does not mention exclusions or context, e.g., that for a specific job's details one should use jobs_get_status.

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