Skip to main content
Glama

yade_interrupt_task

Cancel a queued or interrupt a running YADE simulation task. Uses a graceful interrupt flag and optionally injects a TaskInterrupt exception to break deadlocks.

Instructions

Stop a running YADE task, or cancel one still waiting in the queue.

A task that has not started yet is simply removed from the queue and ends in status canceled (method reports canceled_while_queued). For a running task, two cancellation paths are applied together by the bridge:

  • flag_only — sets an interrupt flag that YADE's PyRunner tick observes between simulation iterations (graceful path for O.run tasks).

  • flag_and_async_exc — in addition, injects a TaskInterrupt exception into the script thread, so pure-Python deadloops with no O.run on the stack are terminated too.

The response method field reports which path ran. When async-exc is refused (e.g. target thread is a Dummy-N boost::python frame), async_exc_skipped_reason explains why.

Namespace after interrupt: the YADE __main__ namespace is shared between tasks and yade_execute_code calls. Any variables the interrupted script had already defined — including O state — are preserved. There's no need to re-run the whole script to continue work: inspect state with yade_execute_code or resume via a fresh yade_execute_task that only runs the remaining logic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesTask ID returned by yade_execute_task

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, so description fully discloses behavior: cancellation paths (flag_only, flag_and_async_exc), response method field, namespace preservation, and async exception handling. Very transparent.

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?

Front-loaded with main purpose, but subsequent paragraphs contain detailed technical explanations. While informative, some sentences could be condensed. Still well-structured for the complexity.

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?

Covers task states, cancellation paths, namespace impact, and response details. Given the tool's complexity and presence of an output schema, the description is thorough and complete.

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

Parameters4/5

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

Schema coverage is 100% and description adds context: 'Task ID returned by yade_execute_task'. While schema already describes the parameter, the description clarifies its source and usage, adding value beyond the schema.

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?

Clearly states 'Stop a running YADE task, or cancel one still waiting in the queue.' Specific verb and resource, distinct from sibling tools like yade_execute_task or yade_list_tasks.

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

Usage Guidelines5/5

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

Provides when to use (interrupt/cancel tasks) and explicitly references alternatives for inspecting state (yade_execute_code) and resuming (yade_execute_task), offering clear guidance.

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/yusong652/yade-mcp'

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