Skip to main content
Glama

Get OEIS Sequence Terms

oeis_get_terms
Read-onlyIdempotent

List terms a(n) of a sequence with their indices n. Reads the entry's b-file when it has one — often thousands of terms beyond the data line — and otherwise the data line itself. Values are exact decimal strings of any size. A slice stops at limit terms (at most 1000 per call), at about 100,000 bytes, or at the end of one 1 MiB part of a larger b-file, whichever comes first; nextFromIndex continues it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of terms to return (default 100). One call returns at most 1000, so a larger limit is served as 1000. A slice stops sooner at about 100,000 bytes of large terms or at the end of one 1 MiB part of a larger b-file; continue with nextFromIndex.
aNumberYesOEIS A-number, e.g. "A000045"; oeis_identify_sequence and oeis_search_sequences return them. Also accepts "a000045", "A45", "45", and an oeis.org sequence URL; all normalize to the zero-padded form. Legacy M/N book numbers (e.g. "M1459") are not A-numbers: find them with oeis_search_sequences.
fromIndexNoFirst index n to return; defaults to the first available index. Pass nextFromIndex from the previous call to continue.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe limit that was applied: limit, or 1000 when limit is larger.
urlNoSequence page on oeis.org; cite it wherever the terms are reused.
errorNoPresent when the call failed. Absent on success.
shownNoTerms in this slice.
termsNoTerms in index order, from the first index at or after fromIndex (or the first available index).
noticeNoGuidance: where the next slice starts and whether the byte budget ended this one, why no terms came back (past the last index, or not yet reached in a large b-file), that a b-file line too long to read was skipped, how many lines of the b-file part this slice comes from are not n a(n) pairs and were skipped, that only the first 1 MiB of the b-file could be read, or that the terms are data-line only.
sourceNobfile: read from the entry's b-file of extended terms. data: the entry has no b-file, so these are its data-line terms.
aNumberNoA-number, e.g. "A000045".
bFileCutNoTrue while the b-file goes on past lastAvailableIndex. Its later terms are at bFileUrl; nextFromIndex or a larger fromIndex reaches them unless the notice says only the first 1 MiB was read.
bFileUrlNoURL of the b-file the terms came from; absent when source is data.
truncatedNoTrue when nextFromIndex is set.
nextFromIndexNoPass as fromIndex for the next slice. Absent when no slice follows this one: the terms ended, or the notice says how to reach the rest.
bFileSizeInBytesNoFull size of the b-file as OEIS reported it; absent when not reported.
lastAvailableIndexNoHighest index n read so far for this entry; when bFileCut is true the b-file goes on past it. Absent when no terms were read.
firstAvailableIndexNoLowest index n read for this entry; absent when no terms were read.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of terms to return, 1–1000 (default 100). A slice stops sooner at about 100,000 bytes of large terms or at the end of one 1 MiB part of a larger b-file; continue with nextFromIndex."New value: +"Maximum number of terms to return (default 100). One call returns at most 1000, so a larger limit is served as 1000. A slice stops sooner at about 100,000 bytes of large terms or at the end of one 1 MiB part of a larger b-file; continue with nextFromIndex."
    • changedInput schema / properties / limit / maximum
      Previous value: -1000New value: +9007199254740991
    • changedOutput schema / properties / cap / description
      Previous value: -"The limit that was applied."New value: +"The limit that was applied: limit, or 1000 when limit is larger."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `sequence_not_found`: No OEIS entry exists for the requested A-number. `pacer_shed`: The oeis.org request queue would exceed its wait budget. `upstream_rate_limited`: oeis.org answered HTTP 429 Too Many Requests on the b-file or the record and retries within the call did not clear it. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `sequence_not_found`: No OEIS entry exists for the requested A-number. `pacer_shed`: The oeis.org request queue would exceed its wait budget. `upstream_rate_limited`: oeis.org answered HTTP 429 Too Many Requests on the b-file or the record and retries within the call did not clear it. `upstream_unparseable`: oeis.org answered with a body that is not a b-file or a sequence record (an HTML maintenance page, a b-file with no n a(n) line, or a record in an unknown shape) and retries within the call did not clear it. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "sequence_not_found",
      -  "pacer_shed",
      -  "upstream_rate_limited"
      -]New value: +[
      +  "sequence_not_found",
      +  "pacer_shed",
      +  "upstream_rate_limited",
      +  "upstream_unparseable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance: where the next slice starts and whether the byte budget ended this one, why no terms came back (past the last index, or not yet reached in a large b-file), that a b-file line too long to read was skipped, that only the first 1 MiB of the b-file could be read, or that the terms are data-line only."New value: +"Guidance: where the next slice starts and whether the byte budget ended this one, why no terms came back (past the last index, or not yet reached in a large b-file), that a b-file line too long to read was skipped, how many lines of the b-file part this slice comes from are not n a(n) pairs and were skipped, that only the first 1 MiB of the b-file could be read, or that the terms are data-line only."
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses real operational traits: b-file vs data-line sourcing, exact decimal strings of arbitrary size, three distinct slice-stop conditions (limit, ~100,000 bytes, end of a 1 MiB b-file part), and the nextFromIndex continuation mechanism. This is exactly the kind of behavior an agent needs to page correctly.

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?

Three sentences, all load-bearing, with the core purpose front-loaded before the sourcing and slicing details. Nothing is redundant padding.

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?

With an output schema present, return shape need not be explained; the description still covers sourcing, value format, truncation behavior, and continuation, which is everything an agent needs to call and page this tool correctly.

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 documents aNumber, limit, and fromIndex in detail. The description restates the 1000-term cap and the byte/part stop conditions but adds no syntax or format detail the schema lacks, so the baseline 3 applies.

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: 'List terms a(n) of a sequence with their indices n.' That is distinguishable from oeis_get_sequence (entry metadata) and oeis_search_sequences (finding sequences) without opening any schema.

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?

Usage is implied rather than stated: the description explains that it reads the b-file when present and the data line otherwise, which hints at when the tool is useful. However, it never explicitly names oeis_get_sequence or any sibling as the alternative for metadata or for finding sequences, and gives no when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.