Skip to main content
Glama
roman-zaglauer

OctoBot MCP Server

update_exchange_credentials

Write exchange API credentials to OctoBot's global configuration after explicit confirmation, returning only the key's last four digits to avoid exposing secrets.

Instructions

Write an exchange's API credentials to OctoBot's global config. Confirm-gated (ADR-0003).

If confirm is not exactly true, no OctoBot call is made at all -- this returns require_confirmation's structured refusal (a normal return, not an error) instead. Reason given: "writes exchange API credentials; verify the exchange name and that you intend to grant this key trading access" (per spec).

Once confirmed, maps to POST /config with JSON body {"global_config": {"exchanges_<exchange>_api-key": api_key, "exchanges_<exchange>_api-secret": api_secret[, "exchanges_<exchange>_ api-password": api_password]}} -- see this module's docstring ("Milestone 12") for the full, source-verified derivation of this exact shape (open question #2, now resolved) and its known limitation.

Refuses locally, before any OctoBot call, if exchange contains an underscore -- confirmed against source (octobot_commons.configuration.config_operations.parse_and_update) that OctoBot's own config-path decoder would otherwise split the generated "exchanges_<exchange>_api-key" key on every literal "_" positionally, silently writing the credential into the wrong nested config location instead of the intended exchange's. Raises ExchangeCredentialsUpdateRejectedError for this case.

INV-4/NFR-6, this tool's one consumer of redact_secrets: OctoBot's own success response for this route (global_updated_config, confirmed against source) echoes the ENTIRE submitted global_config dict back verbatim -- including the raw api_key/api_secret/api_password just sent. This tool therefore never reads OR forwards any part of OctoBot's response body on success: a 2xx status alone is trusted (this route's status code IS a faithful (success, err_message) signal, confirmed against source models/configuration.py::update_global_config, unlike several profiles.py routes that needed a post-hoc re-check), and the tool's own output below is built from only what it already knows locally. On failure, OctoBot's raw error text is passed through redact_secrets with the literal api_key/api_secret/api_password values from THIS call before being included in the raised exception's message -- the single boundary INV-4 requires, not scattered ad-hoc scrubbing.

Output on success: {"exchange": str, "updated": true, "api_key_last4": str} -- never the full api_key/api_secret, per NFR-6.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyYes
confirmNo
exchangeYes
api_secretYes
api_passwordNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It thoroughly covers the confirm gate, local refusal for underscores, the exact request mapping, the decision to ignore the success response body, secret redaction on failure, and the minimal success output. This is exceptional transparency for a credential-writing tool.

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?

The description is long but well-structured and front-loaded with the one-sentence purpose. The detailed paragraphs are earned given the security-sensitive behavior and lack of annotations, though some internal references (e.g., 'open question #2, now resolved', 'see this module's docstring') add noise and could be trimmed.

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 5-parameter tool with no output schema and no annotations, this description is remarkably complete. It specifies input semantics, confirmation behavior, local validation, failure handling, the success response shape, and why the response body is never forwarded. An agent has enough information to call this tool safely and interpret its result.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does. It explains the exact meaning and effect of exchange, api_key, api_secret, api_password, and confirm, including the requirement for confirm to be exactly true and the underscore restriction on exchange. Every parameter's role is semantically enriched beyond the raw 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?

The description opens with a specific verb and resource: 'Write an exchange's API credentials to OctoBot's global config.' This clearly identifies what the tool does and naturally distinguishes it from sibling tools focused on trading config, evaluator config, or profile management.

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

Usage Guidelines4/5

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

The intended use is strongly implied by the purpose statement: use this tool to write exchange API credentials into the global config. It does not explicitly name alternatives or exclusions, but the operation is specific enough that an agent can tell when it applies. Slightly more explicit routing relative to update_trading_config or update_evaluator_config would make it a 5.

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