Skip to main content
Glama
loda-lang

LODA API MCP Server

Official
by loda-lang

get_sequence

Retrieve details about mathematical integer sequences from OEIS by providing their ID, such as A000045 for the Fibonacci sequence.

Instructions

Get details about an integer sequence by ID (e.g. A000045)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSequence ID (e.g. A000045)

Implementation Reference

  • The primary handler function for the 'get_sequence' tool. It validates the sequence ID format, fetches the sequence details using the API client, formats a text response with key information (name, terms, keywords, authors, OEIS ref), and returns it in the MCP content format.
    private async handleGetSequence(args: { id: string }) {
      const { id } = args;
      if (!/^A\d{6,}$/.test(id)) {
        throw new McpError(ErrorCode.InvalidParams, "id must be a string like A000045");
      }
      const seq = await this.apiClient.getSequence(id);
      return {
        content: [
          {
            type: "text",
            text: `Sequence ${seq.id}: ${seq.name}\n` +
              `First terms: ${seq.terms.slice(0, 20).join(', ')}${seq.terms.length > 20 ? '...' : ''}\n` +
              (seq.keywords ? `Keywords: ${seq.keywords.join(', ')}\n` : '') +
              (Array.isArray((seq as any).authors) && (seq as any).authors.length ? `Authors: ${(seq as any).authors.join(', ')}\n` : '') +
              (seq.oeisRef ? `OEIS: ${seq.oeisRef}\n` : '')
          }
        ]
      };
    }
  • The input schema definition for the 'get_sequence' tool, specifying that it requires a string 'id' parameter (e.g., A000045).
    inputSchema: {
      type: "object",
      properties: {
        id: { type: "string", description: "ID of the integer sequence (e.g. A000045)" }
      },
      required: ["id"],
      additionalProperties: false
    }
  • src/index.ts:340-351 (registration)
    The tool registration in the listTools response, defining name, description, and inputSchema for 'get_sequence'.
    {
      name: "get_sequence",
      description: "Retrieve detailed information about an integer sequence, including its terms, references, links, and keywords. The ID must match the sequence (e.g. A000045).",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "string", description: "ID of the integer sequence (e.g. A000045)" }
        },
        required: ["id"],
        additionalProperties: false
      }
    },
  • Helper method in LODAApiClient that fetches sequence details from the LODA API endpoint `/sequences/{id}`.
    async getSequence(id: string): Promise<SequenceDetails> {
      return this.makeRequest(`/sequences/${id}`);
    }
  • TypeScript interface defining the structure of SequenceDetails returned by the API.
    interface SequenceDetails {
      id: string;
      name: string;
      terms: string[];
      keywords?: string[];
      oeisRef?: string | null;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get details' implies a read operation, it doesn't disclose important behavioral traits like error handling (what happens with invalid IDs), rate limits, authentication requirements, or what 'details' actually includes. The description is too minimal for a tool with no annotation coverage.

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 perfectly concise - a single sentence that efficiently communicates the core functionality with a helpful example. Every word earns its place with zero waste or redundancy.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'details' are returned, how errors are handled, or provide any context about the data source or limitations. The agent would need to guess about the return format and error conditions.

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 already fully documents the single 'id' parameter with its description and type. The description adds the example 'A000045' which provides helpful context about the expected format, but doesn't add significant semantic value beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'Get details about an integer sequence by ID' with a specific example (A000045). It uses a specific verb ('Get') and resource ('integer sequence'), but doesn't explicitly differentiate from sibling tools like 'search_sequences' or 'get_program'.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search_sequences' or other sibling tools. It mentions the ID parameter but doesn't explain when this lookup approach is appropriate versus search-based approaches.

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/loda-lang/loda-mcp'

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