Skip to main content
Glama

cancel_sage_session

DestructiveIdempotent

Terminate stuck or long-running SageMath computations and restart the worker, optionally for a specific workspace or the default.

Instructions

Cancel any running Sage computation and restart the worker

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNoWorkspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the same workspace across reconnects and is a bearer credential -- keep it secret. Omit for 'default'.default

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoSession cleared

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.0
    • changedInput schema / properties / session / description
      Previous value: -"Named workspace to use. Workspaces have independent variables; omit for 'default'."New value: +"Workspace to use, as a name or a portable handle. Workspaces have independent variables. A name is scoped to this MCP session; a handle returned by start_sage_session (workspace_token) reaches the same workspace across reconnects and is a bearer credential -- keep it secret. Omit for 'default'."
  2. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / session
      Added value: +{
      +  "default": "default",
      +  "description": "Named workspace to use. Workspaces have independent variables; omit for 'default'.",
      +  "type": "string"
      +}
  3. First observedv0.3.1

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and idempotentHint=true, so the safety profile is partly covered. The description does add the non-obvious behavioral fact that the worker is restarted, but it never says what that restart destroys (in-memory variables, session state) or whether the workspace survives, which is the key question for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with zero filler. It earns its place, though it is arguably under-specified rather than optimally concise given the tool's destructive nature.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists and the sole parameter is fully documented in the schema, but the description is the only place an agent could learn how this differs from the three sibling session-control tools, and it omits that entirely. For a destructive tool in a dense sibling cluster, this is materially incomplete.

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?

Schema description coverage is 100% and the session parameter is documented in exhaustive detail in the schema itself (name vs. portable handle, bearer-credential warning). The description contributes nothing about the parameter, so the baseline 3 applies.

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?

States a specific verb (cancel) plus resource (running Sage computation) and adds the secondary effect of restarting the worker, so the agent knows what happens. However, it does nothing to distinguish itself from the nearly identical siblings interrupt_sage_session, stop_sage_session, and reset_sage_session.

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?

There is no when-to-use guidance and no mention of alternatives, which is a serious gap given four sibling tools (cancel/interrupt/stop/reset) that look interchangeable from the name alone. The agent is left to guess which of these should be called to halt a runaway computation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.