Skip to main content
Glama
AnteWall

Avanza MCP Server

by AnteWall

get_recent_trades

Read-onlyIdempotent

Page through an available trade snapshot for an Avanza order-book ID to retrieve recent trades in upstream order, using limit and offset for pagination.

Instructions

Page through the latest available trade snapshot in upstream order.

Not a complete trade history or guaranteed real-time feed. Separate page requests may observe a changed snapshot; total is the current source count.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tradesYes
paginationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.1.0
    • removedOutput schema / additionalProperties
      Removed value: -true
    • removedOutput schema / properties / trades / items / additionalProperties
      Removed value: -true
    • addedOutput schema / properties / trades / items / properties / buyerName
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedOutput schema / properties / trades / items / properties / sellerName
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed8 schema fields changedv2.0.0
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / instrument_id
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 20,
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • 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 / properties
      Added value: +{
      +  "pagination": {
      +    "properties": {
      +      "has_more": {
      +        "type": "boolean"
      +      },
      +      "limit": {
      +        "maximum": 100,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "offset": {
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "returned": {
      +        "type": "integer"
      +      },
      +      "total": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "description": "Source count; null when the selected section is unavailable"
      +      }
      +    },
      +    "required": [
      +      "offset",
      +      "limit",
      +      "total",
      +      "returned",
      +      "has_more"
      +    ],
      +    "type": "object"
      +  },
      +  "trades": {
      +    "items": {
      +      "additionalProperties": true,
      +      "description": "Individual trade information.",
      +      "properties": {
      +        "buyer": {
      +          "type": "string"
      +        },
      +        "cancelled": {
      +          "type": "boolean"
      +        },
      +        "dealTime": {
      +          "type": "integer"
      +        },
      +        "matchedOnMarket": {
      +          "type": "boolean"
      +        },
      +        "price": {
      +          "type": "number"
      +        },
      +        "seller": {
      +          "type": "string"
      +        },
      +        "volume": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "buyer",
      +        "seller",
      +        "dealTime",
      +        "price",
      +        "volume",
      +        "matchedOnMarket",
      +        "cancelled"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "trades",
      +  "pagination"
      +]
  3. First observedv0.1.0

TDQS

B3.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, openWorld, non-destructive). The description adds genuinely new behavioral context beyond that: snapshot semantics, the fact that separate page requests may observe a changed snapshot, and that total reflects the current source count. This is exactly the consistency/pagination nuance an agent needs.

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?

Three short sentences, front-loaded with the core action, and each sentence carries a distinct caveat. No filler or repetition.

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

Completeness3/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 values need not be explained, and annotations carry the safety profile. The description covers snapshot/staleness semantics well but leaves the pagination parameters (limit/offset) unexplained, which is a meaningful gap for a paging tool.

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

Parameters2/5

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

Schema description coverage is only 33% – only order_book_id is documented (and it is described in the schema, not the description). limit and offset carry defaults and bounds but no meaning; the description's mention of 'page' and 'page requests' implies pagination without explaining how limit/offset drive it. The description does not compensate for the coverage gap.

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: 'Page through the latest available trade snapshot in upstream order.' It also scopes what the resource is not (not a full history, not a real-time feed). However, it does not name or distinguish itself from plausible siblings like get_orderbook or get_broker_trade_summary.

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 explicit when-to-use guidance or alternatives are provided. The caveats ('not a complete trade history', 'not guaranteed real-time') hint at constraints but do not tell the agent when to pick this tool over get_orderbook or get_broker_trade_summary.

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