Skip to main content
Glama

Get OEIS Sequence

oeis_get_sequence
Read-onlyIdempotent

Fetch one OEIS entry by A-number. Returns the name, data-line terms, offset, keywords, author, dates, and the sections: comments, formulas (recurrences and generating functions), examples, programs (Maple, Mathematica, PARI, Python, …), references, links, cross-references, and extensions. When the sections together exceed 24,000 characters of serialized JSON, the core fields come back with a section outline instead; call again with sections to pick what to read. A selection past 100,000 bytes comes back in parts cut between items: pass nextFromItem as fromItem, with the same sections, for the next part.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
fromItemNoWhere to resume a cut selection: the previous response's nextFromItem, passed unchanged with the same sections. The selected sections before fromItem.section are left out. Omit to start at the beginning.
sectionsNoSections to return with the core fields, e.g. ["formulas", "programs"]. A selection past the 100,000-byte response budget is cut between items; fromItem continues it. Omit (or pass []) for the full entry, or the core fields plus an outline when the entry is large.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoSequence page on oeis.org; cite it wherever the entry is reused.
kindNofull: every section, or the selected ones (a selection past the 100,000-byte response budget is cut between items, and nextFromItem continues it). outline: the entry is too large, so sections lists the sections to request by name.
nameNoSequence name, written by OEIS contributors.
errorNoPresent when the call failed. Absent on success.
linksNoLink lines. Present on a full entry or when selected; a cut selection carries only this part's lines.
termsNoData-line terms as exact decimal strings, signs kept; the first is a(firstIndex).
authorNoAuthor line as OEIS records it; absent when the entry has none.
noticeNoGuidance: the entry is withdrawn (dead) or its A-number reserved or recycled; where a cut selection stopped and the call that continues it; or that fromItem lies past the end of its section.
offsetNoOffset "i,p": i is the index n of the first term, p the 1-based position of the first term with |a(n)| > 1. Absent on a reserved or recycled A-number (keyword allocated or recycled).
aNumberNoA-number, e.g. "A000045".
createdNoWhen the entry was created, ISO 8601 with offset.
bFileUrlNoURL of the entry's b-file of extended terms; oeis_get_terms reads it.
commentsNoComment lines, one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.
examplesNoExample lines; whitespace matters for triangles and tables, one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.
formulasNoFormula lines: recurrences, generating functions, closed forms, one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.
keywordsNoKeyword flags such as nonn, core, tabl; oeis_list_reference topic keywords decodes them.
modifiedNoWhen the entry was last edited, ISO 8601 with offset.
programsNoPrograms that compute the terms. Present on a full entry or when selected; a cut selection carries only this part's blocks.
revisionNoRevision number of the entry.
sectionsNoOutline only: the sections of the entry, largest first.
legacyIdsNoLegacy book numbers, e.g. ["M0692", "N0256"]; absent on entries that have none.
extensionsNoExtension lines: who added terms or corrections, and when, one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.
firstIndexNoThe index n of the first term (the first number of offset); absent with offset.
referencesNoReference lines (books and papers), one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.
nextFromItemNoPresent when the selection was cut at the 100,000-byte response budget: the first item left out. Pass it unchanged as fromItem, with the same sections, to continue.
outlineNoticeNoOutline only: how to request sections, and how a large selection continues.
referenceCountNoHow many OEIS entries mention this A-number, the entry itself included.
crossReferencesNoCross-reference lines naming related A-numbers, one element per upstream line, written by OEIS contributors. Present on a full entry or when selected; a cut selection carries only this part's lines.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations cover safety (readOnly/idempotent/openWorld), and the description goes well beyond them by disclosing two non-obvious behaviors: the 24,000-character threshold that degrades the response to core fields plus a section outline, and the 100,000-byte budget that cuts responses between items requiring nextFromItem to resume. This is exactly the operational context annotations cannot provide.

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 front-loaded sentences: identification, payload contents, then the two truncation/pagination rules. Efficient, though the section/outline behavior is stated once in the description and again across the schema, producing mild redundancy.

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?

For a read tool with an output schema, the description covers everything an agent needs to call it correctly and to handle the truncation/pagination loop, which is the only real complexity. No return-value explanation is needed since the output schema exists.

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

Parameters4/5

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

Schema description coverage is 100% and already documents aNumber normalization, sections, and fromItem, so the baseline is 3. The description adds real interaction semantics not in the schema: the outline fallback tied to omitting sections, and the requirement to pass nextFromItem 'with the same sections' when continuing a cut response.

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?

States a specific verb and resource ('Fetch one OEIS entry by A-number') and enumerates exactly what the entry contains. An agent can distinguish it from siblings like oeis_get_terms (terms only) or oeis_get_cross_refs (cross-references only) without opening the 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 schema note points to oeis_identify_sequence and oeis_search_sequences as sources of A-numbers, and to oeis_search_sequences for legacy M/N numbers, but the description never says when to prefer this tool over the other lookup siblings or what preconditions exist. Guidance is present but indirect.

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.