Skip to main content
Glama
AnteWall

Avanza MCP Server

by AnteWall

get_orderbook

Read-onlyIdempotent

Retrieve available buy and sell depth for an Avanza order book using its discovery ID; empty levels are valid and data may not be real-time.

Instructions

Get latest available buy/sell depth; empty levels are valid. Not guaranteed real-time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_book_idYesAvanza order-book ID from discovery; not the separate instrumentId.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelsNo
receivedTimeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.1.0
    • removedOutput schema / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / levels / items / additionalProperties
      Removed value: -true
    • changedOutput schema / properties / levels / items / properties / buySide / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "description": "Buy or sell side of an order.",
      -    "properties": {
      -      "price": {
      -        "type": "number"
      -      },
      -      "priceString": {
      -        "type": "string"
      -      },
      -      "volume": {
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "price",
      -      "volume",
      -      "priceString"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Buy or sell side of an order.",
      +    "properties": {
      +      "price": {
      +        "type": "number"
      +      },
      +      "priceString": {
      +        "type": "string"
      +      },
      +      "volume": {
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "price",
      +      "volume",
      +      "priceString"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / levels / items / properties / sellSide / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "description": "Buy or sell side of an order.",
      -    "properties": {
      -      "price": {
      -        "type": "number"
      -      },
      -      "priceString": {
      -        "type": "string"
      -      },
      -      "volume": {
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "price",
      -      "volume",
      -      "priceString"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "description": "Buy or sell side of an order.",
      +    "properties": {
      +      "price": {
      +        "type": "number"
      +      },
      +      "priceString": {
      +        "type": "string"
      +      },
      +      "volume": {
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "price",
      +      "volume",
      +      "priceString"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed6 schema fields changedv2.0.0
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / instrument_id
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / order_book_id
      Added value: +{
      +  "description": "Avanza order-book ID from discovery; not the separate instrumentId.",
      +  "minLength": 1,
      +  "pattern": "^[0-9]+$",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "instrument_id"
      -]New value: +[
      +  "order_book_id"
      +]
    • addedOutput schema / description
      Added value: +"Order book depth showing buy and sell orders."
    • addedOutput schema / properties
      Added value: +{
      +  "levels": {
      +    "default": [],
      +    "items": {
      +      "additionalProperties": true,
      +      "description": "Single level in the order book depth.",
      +      "properties": {
      +        "buySide": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": true,
      +              "description": "Buy or sell side of an order.",
      +              "properties": {
      +                "price": {
      +                  "type": "number"
      +                },
      +                "priceString": {
      +                  "type": "string"
      +                },
      +                "volume": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "price",
      +                "volume",
      +                "priceString"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        },
      +        "sellSide": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": true,
      +              "description": "Buy or sell side of an order.",
      +              "properties": {
      +                "price": {
      +                  "type": "number"
      +                },
      +                "priceString": {
      +                  "type": "string"
      +                },
      +                "volume": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "price",
      +                "volume",
      +                "priceString"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  "receivedTime": {
      +    "anyOf": [
      +      {
      +        "type": "integer"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "default": null
      +  }
      +}
  3. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, so the safety profile is covered. The description still adds real behavioral context: that empty levels are a valid response (not an error) and that freshness is not guaranteed. It doesn't cover pagination or depth limits, keeping it below 5.

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?

Two short clauses with zero filler; the core purpose leads and the two caveats follow. Every sentence earns its place.

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?

An output schema exists, so return structure needn't be described. Combined with annotations and the freshness/empty-level caveats, the definition is sufficient for correct invocation, though it could have said when to prefer this over other market-data siblings.

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 coverage is 100% and the schema itself already disambiguates order_book_id from instrumentId, so the description adds nothing param-specific. Baseline 3 is appropriate when structured fields carry the full parameter burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (get buy/sell depth from an order book), which is clear enough to distinguish from sibling quote/trade tools. It does not explicitly name an alternative sibling, so it stops short of 5.

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

Usage Guidelines2/5

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

No when-to-use, when-not-to-use, or alternative tool is mentioned. The two caveats ('empty levels are valid', 'not guaranteed real-time') describe data characteristics, not invocation context, so an agent gets no routing guidance versus get_stock_quote or get_recent_trades.

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