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 returns up to limit terms (at most 1000 per call) and may read the next b-file part to fill it. Pass nextFromIndex to continue.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "aNumber": "<aNumber>"
    },
    "name": "oeis_get_terms"
  }
}

Input 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 can end early when fewer terms are available to this call. Pass nextFromIndex to continue.
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

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 on continuing the slice, a short or empty slice, skipped b-file lines, the b-file read bounds, or data-line-only terms.
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 when the b-file may contain terms beyond lastAvailableIndex. Follow nextFromIndex or the notice to check, or consult bFileUrl.
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 may contain terms beyond 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. Changed4 schema fields changed
    • changedInput schema / properties / limit / description
      Previous 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."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 can end early when fewer terms are available to this call. Pass nextFromIndex to continue."
    • changedOutput schema / properties / bFileCut / description
      Previous value: -"True 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."New value: +"True when the b-file may contain terms beyond lastAvailableIndex. Follow nextFromIndex or the notice to check, or consult bFileUrl."
    • changedOutput schema / properties / lastAvailableIndex / description
      Previous value: -"Highest 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."New value: +"Highest index n read so far for this entry; when bFileCut is true the b-file may contain terms beyond it. Absent when no terms were read."
    • 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, 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."New value: +"Guidance on continuing the slice, a short or empty slice, skipped b-file lines, the b-file read bounds, or data-line-only terms."
  2. 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."
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, openWorld), and the description adds real behavioral context on top: it discloses the b-file-vs-data-line source, that results are exact decimal strings of unbounded size, the 1000-term per-call ceiling, and that a slice may end early. It does not mention failure modes for an invalid A-number, but the source-selection behavior is genuinely informative.

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?

Four short sentences, front-loaded with the core purpose before the b-file detail and slicing behavior. Minor redundancy: "Pass nextFromIndex to continue" duplicates guidance already present in the fromIndex and limit schema descriptions.

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?

An output schema exists, so return values need not be explained, and the description still covers what is returned (terms plus indices, exact decimal strings), where they come from, the per-call ceiling, and how to paginate. That is complete enough to call correctly without opening the schema.

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 normalization, the limit cap, and fromIndex/nextFromIndex. The description restates the 1000 cap and continuation rather than adding new syntax or semantics, so baseline 3 applies.

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: "List terms a(n) of a sequence with their indices n." That is clearly distinct in kind from an entry-metadata tool, though it never names a sibling to contrast itself with (e.g. oeis_get_sequence for metadata vs. this for raw terms).

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?

Implied usage is clear — call this when you need actual term values — and it explains continuation via nextFromIndex. It gives no explicit when-not guidance or named alternative for retrieving sequence metadata, so routing between this and oeis_get_sequence is left to inference.

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.