Skip to content

Tool reference

This page is generated from the server's tool definitions (src/mcp/tool_meta.ts) — the same source the running server registers, so it never drifts.

All 9 tools are read-only (readOnlyHint: true), deterministic over the pinned spec commit, and perform no execution or network I/O.

spec_version

Return self-description of this MCP server: package name + version, plus the pinned upstream commit SHA for every spec snapshot baked into the package. Use this first when citing the spec, or to verify the server's freshness and reproducibility.

Title: Pinned spec version

No parameters.

instruction_get

Fetch one WebAssembly instruction by mnemonic (i32.add, br_if) or binary opcode (0x6a, 0xfd 0x89 0x02) as structured JSON: opcode bytes, category, introducing version, stack type signature, and validation/execution prose anchors + spec URLs. Provide mnemonic or opcode (mnemonic wins if both match).

Title: Get instruction

FieldTypeRequiredDescription
mnemonicstringnoInstruction mnemonic, e.g. i32.add, br_if, local.get. Case-insensitive. Exact match.
opcodestringnoBinary opcode as hex bytes, e.g. 0x6a, 6a, or multi-byte 0xfd 0x89 0x02. Exact match. Used when mnemonic is absent or doesn't match.
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • Get the i32.add instruction
    json
    {"mnemonic":"i32.add"}
    Returns opcode 0x6a, the [i32 i32] → [i32] signature, and validation/execution anchors.
  • What instruction is opcode 0x0d?
    json
    {"opcode":"0x0d"}
    Reverse lookup by binary opcode — resolves to br_if.

instruction_list

Enumerate WebAssembly instructions with optional filters: category (control, numeric, parametric, variable, table, memory, ref, i31, struct, array, extern, vec), introduced_in (1.0 | 2.0 | 3.0), and prefix (mnemonic prefix like i32.). Returns lightweight rows sorted by opcode; follow up with instruction_get for full detail.

Title: List instructions

FieldTypeRequiredDescription
categorycontrol | numeric | parametric | variable | table | memory | ref | i31 | struct | array | extern | vecnoFilter by instruction category: control, numeric, parametric, variable, table, memory, ref, i31, struct, array, extern, vec (vector/SIMD).
introduced_in1.0 | 2.0 | 3.0noFilter to instructions introduced in this WebAssembly version: 1.0, 2.0, or 3.0.
prefixstringnoFilter to mnemonics starting with this prefix, e.g. i32. or v128.. Case-insensitive.
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • List all control-flow instructions
    json
    {"category":"control"}
    Filters to the control category; rows are sorted by opcode.
  • What memory instructions did Wasm 3.0 add?
    json
    {"category":"memory","introduced_in":"3.0"}
    Combine category + introduced_in to see what a release contributed.
  • List the i32 numeric instructions
    json
    {"prefix":"i32."}
    Prefix filter is the quickest way to scope to one type family.

Search WebAssembly instructions by free-text query, matched against mnemonic (exact > substring), category name, and opcode hex. The entry point when you don't know the exact mnemonic. Returns ranked lightweight hits with a matched_on field; follow up with instruction_get.

Title: Search instructions

FieldTypeRequiredDescription
querystringyesSearch text. Matched against mnemonic (exact > substring), category name, and opcode hex. E.g. extend, trunc, vec, 0x6a.
limitnumbernoMax ranked hits returned. (default: 20)
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • Find all the extend instructions
    json
    {"query":"extend"}
    Substring match across mnemonics surfaces i32.extend8_s, i64.extend_i32_u, etc.
  • Which instruction has opcode 0x6a?
    json
    {"query":"0x6a"}
    A hex query also matches by opcode — resolves i32.add at the top.

type_get

Look up a WebAssembly type or type form by name: concrete value types (i32, i64, f32, f64, v128, funcref, externref, …) or type forms (functype, limits, memtype, tabletype, globaltype, reftype, valtype, rectype, heaptype, …). Returns its classification, sibling members for category types, defining clause prose, SpecTec formal-rule references, and the rendered spec URL.

Title: Get type

FieldTypeRequiredDescription
namestringyesType or type-form name. Concrete value types: i32, i64, f32, f64, v128, funcref, externref, … Type forms: functype, limits, memtype, tabletype, globaltype, reftype, valtype, rectype, heaptype, … Case-insensitive, exact match.
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • What is the i32 type?
    json
    {"name":"i32"}
    Returns kind=number, the sibling number types (i64/f32/f64), and the Number Types clause prose + URL.
  • Describe a function type
    json
    {"name":"functype"}
    Type forms like functype/limits/memtype resolve to their defining clause in the types section.

section_get

Fetch one spec clause by id or anchor, across core / js-api / web-api (set spec). For core: syntax-numtype, valid-unreachable, binary-instr, … For the embedding specs: modules, memories, streaming-modules, … Matches the rendered spec's stable fragment ids. Returns the clause title, cleaned prose, cross-references, the SpecTec formal_refs it cites (core), and the rendered URL. Core validation/execution clauses are SpecTec-generated: prose may be terse, but formal_refs + url point to the formal rule.

Title: Get spec section

FieldTypeRequiredDescription
idstringyesClause id or anchor. For core: syntax-numtype, valid-unreachable, binary-instr, … For js-api / web-api: modules, memories, streaming-modules, … These match the stable fragment ids in the rendered spec.
speccore | js-api | web-apinoWhich WebAssembly spec to query: core (default; instructions, types, validation, execution, formats), js-api (JavaScript embedding), or web-api (Web platform integration). (default: core)
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • Get the number types section
    json
    {"id":"syntax-numtype"}
    Returns the Number Types clause: prose, the i32/i64/f32/f64 formal refs, and the spec URL.
  • Read the validation rule anchor for unreachable
    json
    {"id":"valid-unreachable"}
    Validation/execution clauses are SpecTec-spliced; prose may be terse but formal_refs names the rule and url links the rendered notation.

section_list

Enumerate spec clauses for navigation, across core / js-api / web-api (set spec). Filter by source path (core: intro, syntax, valid, exec, binary, text, appendix, or sub-paths like syntax/types), anchor_prefix, titled_only, and max_level. Returns lightweight rows {id, anchors, title, level, path, url}; follow up with section_get.

Title: List spec sections

FieldTypeRequiredDescription
speccore | js-api | web-apinoWhich WebAssembly spec to query: core (default; instructions, types, validation, execution, formats), js-api (JavaScript embedding), or web-api (Web platform integration). (default: core)
pathstringnoFilter to a source path / prefix. Top-level areas: intro, syntax (structure), valid (validation), exec (execution), binary, text, appendix. Sub-paths like syntax/types also work.
anchor_prefixstringnoFilter to clauses whose id/anchor starts with this prefix, e.g. syntax-, valid-, exec-.
titled_onlybooleannoDrop anchor-only content blocks (keep only clauses with a heading). (default: false)
max_levelnumbernoCap heading depth (1 = page titles only). Anchor-only blocks are unaffected.
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • Outline the binary format sections
    json
    {"path":"binary","titled_only":true}
    Path filter scopes to one area; titled_only yields a clean outline.
  • List every validation clause
    json
    {"anchor_prefix":"valid-"}
    Anchor-prefix filter gathers all clauses in one rule family.

Full-text search across the section index of a spec (core / js-api / web-api, set spec) — clause anchors/ids, titles, and prose. The entry point when you don't know the exact anchor. Returns ranked hits with a matched_on field (anchor-exact > title > anchor > prose) and a prose snippet for body matches; follow up with section_get.

Title: Search spec

FieldTypeRequiredDescription
querystringyesSearch text. Matched against clause anchors/ids, titles, and prose. E.g. block type, trap, funcref, streaming compilation.
speccore | js-api | web-apinoWhich WebAssembly spec to query: core (default; instructions, types, validation, execution, formats), js-api (JavaScript embedding), or web-api (Web platform integration). (default: core)
limitnumbernoMax ranked hits returned. (default: 20)
versionmain | latestnoWebAssembly spec version to query. latest (default) is the current served version; main is the upstream working draft. (default: latest)

Examples

  • Where does the spec define traps?
    json
    {"query":"trap"}
    Ranks title matches above prose matches; prose hits include a snippet around the match.
  • Find the block type section
    json
    {"query":"block type"}
    Title substring search surfaces syntax-blocktype near the top.

proposal_list

List WebAssembly proposals and their phases from the pinned WebAssembly/proposals repository. Filter by status (phase-0…phase-5, finished, inactive), phase (0–5), champion substring, affects (finished proposals touching core / js-api / web-api), or contains (name/champion substring). Each row carries name, status, phase, champion, affected_specs, spec_version, and the proposal URL.

Title: List WebAssembly proposals

FieldTypeRequiredDescription
statusphase-0 | phase-1 | phase-2 | phase-3 | phase-4 | phase-5 | finished | inactivenoFilter by lifecycle status: phase-0phase-5, finished (merged into the spec), or inactive.
phasenumbernoFilter by numeric phase 0–5 (active + finished proposals carry a phase).
championstringnoChampion substring, case-insensitive.
affectsstringnoFilter to finished proposals affecting a given spec: core, js-api, or web-api.
containsstringnoName or champion substring, case-insensitive.

Examples

  • What proposals are finished and in Wasm 3.0?
    json
    {"status":"finished","affects":"core"}
    Finished proposals carry affected_specs + spec_version; filter by the spec they touched.
  • What's in phase 3?
    json
    {"phase":3}
    Phase filter scopes to one stage of the proposal process.

Released under the MIT License.