Skip to main content
Glama

Cancel a job (free)

kimi_job_cancel
Idempotent

Cancel a running background job gracefully, cleaning up its temporary worktree and marking it as cancelled. Idempotent, so retrying after a lost response is safe; free, no model call.

Instructions

Cancel a running background Kimi job.

Asks the worker to shut down gracefully so it tears down its throwaway worktree, then force-kills it if it overstays, and marks the job cancelled (cancelled jobs cannot be resumed). If the worktree could not be removed, cleanup_warnings names the leftover path. Already-terminal jobs are returned unchanged, so cancel is idempotent — a retry after a lost response is safe. Free — no model call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job_id from an *_async call or a sync call's meta.job_id; recover lost ids with kimi_job_list.
workspace_rootNoAbsolute path to the target repo root — pass it (or an MCP root) to target the intended repo; otherwise the call falls back to the server's own cwd and sets meta.workspace_warning.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
Behavior5/5

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

The description reveals how the cancellation works (graceful shutdown, force-kill, worktree teardown), the consequence that cancelled jobs cannot be resumed, cleanup warnings for leftover paths, idempotency, and cost. This goes well beyond the annotations, which only state idempotentHint=true and offensiveHints. No contradiction with annotations exists.

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 front-loaded with the core purpose and then provides structured, spaced sentences for behavior, cleanup warnings, idempotency, and cost. Every sentence adds value without redundancy, achieving a balance of detail and brevity.

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 description fully explains the tool's side effects, idempotency, and output-related details (cleanup_warnings). With an output schema present, there is no need to list return values. Coverage of parameters is complete via schema, and the behavioral details make the tool's usage and consequences clear.

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 schema already provides 100% coverage for both parameters with detailed descriptions (e.g., job_id provenance and workspace_root fallback behavior). The tool description does not add additional parameter-specific semantics, so the baseline score of 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 opens with a specific verb and resource: "Cancel a running background Kimi job." It clearly distinguishes itself from siblings like kimi_job_status (status only) and kimi_job_result (result retrieval) by focusing on cancellation and its side effects.

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?

The description implies when to use the tool by describing its behavior and stating that already-terminal jobs are returned unchanged, making it safe to retry. It also notes the tool is free, which is a cost-oriented usage consideration. However, it does not explicitly name alternatives or state when not to use it beyond the idempotency note.

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/briandconnelly/moonbridge'

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