Skip to main content
Glama

Take over write lock

dsh_takeover
Destructive

Preempt a conversation's write lock. DSH's write lock is a cross-process kernel semaphore that never expires while its holder lives, and no API can take it away: the only means is killing the holder, so this tool first works out who…

Instructions

Preempt a conversation's write lock. DSH's write lock is a cross-process kernel semaphore that never expires while its holder lives, and no API can take it away: the only means is killing the holder, so this tool first works out who that is. (1) If the lock is actually free, a normal resume follows and nothing is killed. (2) If the holder is an orphan this server left behind, its OS start time must match the registration before takeover. (3) Another live dsh-any-agent instance also requires force=true. (4) If the holder is unknown, or its start time is missing or differs from the registration, release the conversation in its original host and retry. Killing a holder that is running a turn interrupts that turn (logged as interrupted); the conversation itself is unharmed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "conversation_id": "<conversation_id>"
    },
    "name": "dsh_takeover"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoAllow takeover from another live instance or a shared child process. The lock holder’s process identity still has to be verified.
conversation_idYesConversation id, from dsh_start or dsh_list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.5
    • changedInput schema / properties / force / description
      Previous value: -"Only for the \"another live dsh-any-agent instance holds it\" case; it has no effect on a GUI or unknown holder (never killed)."New value: +"Allow takeover from another live instance or a shared child process. The lock holder’s process identity still has to be verified."
  2. Changed2 schema fields changedv0.6.8
    • changedInput schema / properties / conversation_id / description
      Previous value: -"会话 id,来自 dsh_start 或 dsh_list。"New value: +"Conversation id, from dsh_start or dsh_list."
    • changedInput schema / properties / force / description
      Previous value: -"仅用于\"另一个活着的 dsh-any-agent 实例持有\"这一种情况;对 GUI/未知持有者无效(永远不杀)。"New value: +"Only for the \"another live dsh-any-agent instance holds it\" case; it has no effect on a GUI or unknown holder (never killed)."
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, and the description adds the crucial consequences: killing a holder interrupts its running turn (logged as interrupted) while the conversation itself is unharmed, and the lock never expires while its holder lives. It stops short of stating what happens to queued work or how the takeover is reported back, so it is strong but not exhaustive.

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 bold statement followed by a numbered decision tree — efficient and scannable. The parenthetical case (3) and the release-and-retry clause are somewhat dense, but each sentence carries information an agent needs before invoking a destructive takeover.

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

Completeness4/5

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

For a destructive, conditional tool with no output schema, the definition covers preconditions, the four decision branches, and the human-visible consequence of the kill. Remaining gaps are minor, such as what the tool returns and whether the interrupted turn is resumable.

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%, so baseline is 3, but the description adds real meaning for force: it is required specifically when the holder is another live dsh-any-agent instance, and even then the holder's process identity must still be verified. That goes beyond the schema's generic wording.

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?

States a specific verb and resource ('Preempt a conversation's write lock') and immediately explains the underlying mechanism: a cross-process kernel semaphore that cannot be revoked by any API. An agent can tell this apart from release/reclaim-style siblings because the description makes clear the only path is killing the holder.

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?

Enumerates four concrete situations with the action each requires: free lock → normal resume, orphan holder → start-time match, other live instance → force=true, unknown/mismatched holder → release in the original host and retry. That is explicit when-to-use, when-not-to-use, and the alternative path.

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