Skip to main content
Glama
simoneb

ibkr-risk-mcp

by simoneb

check_connection

Read-onlyIdempotent

Check if TWS or IB Gateway is reachable and an account is logged in. Identifies the cause of connection failures and provides hints to fix them.

Instructions

Check whether TWS or IB Gateway is reachable and an account is logged in.

Call this first whenever another tool fails. It separates the four situations that all present as "cannot connect" and need different fixes:

  • not_listening — nothing is on the port. TWS is not running, or IBKR_PORT points at the wrong one; the response lists which of the four default ports (7496 TWS live, 7497 TWS paper, 4001/4002 Gateway) are answering.

  • api_not_enabled — the port answers but the API handshake never completes. "Enable ActiveX and Socket Clients" is off in TWS.

  • client_id_in_use — another script holds this client id.

  • not_logged_in — the API is up but no account is loaded.

  • connected — everything is in place.

hint says what to do about the state in each case.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations already mark the tool as read-only and idempotent. The description adds substantial behavioral context beyond that, such as the meaning of each connection state, the specific default ports checked, and the content of the `hint` field. No contradiction with annotations.

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 well-structured: a one-sentence purpose, a clear 'when to use' directive, and a bulleted list of states with concise explanations. Each sentence adds value and is front-loaded with the most critical information.

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?

With no parameters and an output schema present, the description fully covers what an agent needs to know: the purpose, when to call, the possible states, and what `hint` provides. Nothing crucial is missing for a diagnostic tool of this complexity.

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?

The tool has zero parameters, so the schema coverage is trivially 100%. The description correctly focuses on behavior and output rather than parameters. A baseline of 4 is appropriate since no parameter clarification is needed.

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 clearly states the tool's purpose: 'Check whether TWS or IB Gateway is reachable and an account is logged in.' It also enumerates the five specific states it distinguishes, making the tool's role unmistakable and differentiating it from siblings that handle trading or risk operations.

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?

Explicitly instructs to 'Call this first whenever another tool fails,' which is direct usage guidance. It also explains how to interpret each state and what `hint` provides, giving the agent clear context for when and how to use the tool.

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/simoneb/ibkr-risk-mcp'

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