Skip to main content
Glama

Prepare position close

perps_prepare_position_close
Read-only

Previews closing the open position on one contract. Read-only safety gate: runs risk checks and returns a short-lived confirmation token (~90s). Present the summary, get explicit user confirmation, then call perps_execute_operation with the token. Makes no changes itself. Executing returns the closing order's id, not a position object.

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": {
      "contractId": "<contractId>"
    },
    "name": "perps_prepare_position_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
contractIdYesNumeric contract id from perps_list_contracts with an open position. 0 is a real contract id, not a placeholder for "unset".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, it discloses the token lifetime (~90s), that the call itself mutates nothing, and that the eventual execution returns an order id rather than a position object — a non-obvious return-shape detail. The read-only claim is consistent with readOnlyHint=true and destructiveHint=false.

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?

Four short sentences, each front-loaded with a distinct fact: what it does, its safety posture, the token workflow, and the return shape. Nothing is repeated and no sentence is filler.

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?

For a single-parameter, non-destructive preview tool with no output schema, the definition covers purpose, safety, token expiry, the follow-up call, and what execution returns. An agent has everything needed to call it and act on the result.

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 schema itself already explains that contractId comes from perps_list_contracts and that 0 is a valid id. The description adds no further meaning about the parameter, so the baseline of 3 applies.

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?

"Previews closing the open position on one contract" gives a specific verb (previews), resource (position), and scope (one contract), and the explicit handoff to perps_execute_operation separates it from the execute sibling. An agent can route to it without opening the schema.

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?

It names the exact sequence to follow: present the summary, obtain explicit user confirmation, then call perps_execute_operation with the token. The prerequisite (position must be open, contract id from perps_list_contracts) and the alternative (execute) are both stated, leaving little to infer.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources