Skip to main content
Glama
theagoralabs

Theagora MCP Server

by theagoralabs

view_orderbook

Read-only

View current bids and asks on the exchange with spread information. Filter orders by function ID or service category to analyze market activity.

Instructions

See current bids and asks on the exchange, with spread information. Filter by function or category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionIdNoFilter by specific function ID
categoryNoFilter by service category

Implementation Reference

  • Complete registration of the view_orderbook tool with MCP server, including schema definition and handler function
    // view_orderbook — See current bids and asks
    server.tool(
      'view_orderbook',
      'See current bids and asks on the exchange, with spread information. Filter by function or category.',
      {
        functionId: z.string().optional().describe('Filter by specific function ID'),
        category: z.string().optional().describe('Filter by service category'),
      },
      { readOnlyHint: true, openWorldHint: true },
      async (params) => {
        const result = await client.getOrderBook({
          functionId: params.functionId,
          category: params.category,
        });
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
        };
      }
    );
  • Handler function that executes view_orderbook logic by calling client.getOrderBook and returning JSON formatted results
    async (params) => {
      const result = await client.getOrderBook({
        functionId: params.functionId,
        category: params.category,
      });
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
      };
    }
  • Zod schema defining view_orderbook input parameters: optional functionId and category filters
    {
      functionId: z.string().optional().describe('Filter by specific function ID'),
      category: z.string().optional().describe('Filter by service category'),
    },
  • AgoraApiClient.getOrderBook method that makes HTTP GET request to /orderbook endpoint with optional query parameters
    async getOrderBook(params?: {
      functionId?: string;
      category?: string;
    }): Promise<any> {
      return this.request('/orderbook', { params: params as any });
    }
Behavior3/5

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

Annotations already indicate read-only and open-world behavior, which the description aligns with by using 'see'. The description adds context about filtering capabilities and spread information, but does not disclose further behavioral traits like rate limits, data freshness, or pagination.

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 front-loaded with the core purpose in the first clause and adds filtering details concisely in the second. It uses only two short sentences with zero wasted words, making it highly efficient and easy to parse.

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?

Given the tool's moderate complexity (viewing financial data), rich annotations (read-only, open-world), and full schema coverage, the description is mostly complete. However, the lack of an output schema means it could benefit from clarifying return format or data structure, though this is not critical for basic usage.

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%, so the schema fully documents the two optional parameters. The description adds minimal value by mentioning filtering by 'function or category', which maps to the parameters but does not provide additional semantic details beyond what the schema already specifies.

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 with specific verbs ('see', 'filter') and resources ('current bids and asks', 'spread information'), and it distinguishes itself from siblings by focusing on orderbook viewing rather than actions like placing/canceling orders or managing functions.

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

Usage Guidelines3/5

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

The description implies usage for viewing orderbook data with filtering options, but it does not explicitly state when to use this tool versus alternatives like 'get_market_data' or 'get_market_summary', nor does it provide exclusions or prerequisites for use.

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/theagoralabs/mcp'

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