Knowledgespecs
GET/repositories/{repo_id}/specs/records
List typed entries extracted from spec tables, filtered by record kind
list_spec_records
tree:read
A token needs thetree:readscope: Browse repository trees and blobsGranted bymcp_agent,mcp_agent_write,read_api,read_repository,write_api,write_repository.Every operation this scope unlocksSingle-resource
x-gitmoap-isolation: {"kind":"single_or_self_scoped"}
Paginated
Pass thenext_tokena page returns to get the next one.
A record is one entry of a table the format recognises — an error catalogue, a parameter list,
an invariant — or one checklist item, with its document, line and recognised values. Filter by
record kind, by document, by the kind of section it sits in, or with q, a substring match
across its values of up to 256 characters. An unknown kind is refused with 400 rather than
ignored. Paginated with limit (20 by default, at most 100) and next_token. Anyone who can
see the repository may call it; on a public repository that includes callers who are not signed
in.
Parameters
Path
- repo_idRepositoryId (string · uuid)The repository whose corpus is indexed
Query
- kindstringoptionalRestrict to one record kind: errors, param, invariant, instrument, checkbox, …
- doc_idstringoptionalRestrict to one document
- block_kindstringoptionalRestrict to records inside a section of this kind
- qstringoptionalSubstring match across the recognised slot values
- limitinteger · int32optionalPage size (1-100, default 20)
- next_tokenstringoptionalPagination cursor
Responses
200A page of typed records, grouped by documentapplication/json
itemsarray of object
- coreobject
- doc_idstring
- extraobject
- kindstring
- lineinteger · int32
- row_ordinalinteger · int32
- struckboolean
- anchorstring or nulloptional
- block_kindstring or nulloptional
- markerstring or nulloptional
- table_ordinalinteger · int32 or nulloptional
- next_tokenstring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"core": {},
"doc_id": "63c75f4b-ae91-46c4-bd24-7c92316a5683",
"extra": {},
"kind": "kind-e849",
"line": 34,
"row_ordinal": 6,
"struck": false
},
{
"core": {},
"doc_id": "f5fcaff8-11f7-4788-9db4-2df558fc7148",
"extra": {},
"kind": "kind-ea10",
"line": 19,
"row_ordinal": 43,
"struck": false
}
],
"next_token": "next-token-a374"
}
400Unknown record kind, oversized query or malformed cursorapplication/json
Error codes
- BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-ba0e",
"message": "Pin a page's payload to the build that rendered it"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
- UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-975f",
"message": "Pin a page's payload to the build that rendered it"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames it - PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-4fcc",
"message": "Inline scalar newtypes but keep their brand"
}
}
404Not found — or found and private, which is masked as absentapplication/json
Error codes
- NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-18dd",
"message": "Label every synthesized example"
}
}
CLI
gitmoap specs list-spec-records
- --repo-ididThe repository whose corpus is indexed (id or owner/repo path)
- --block-kindstringoptionalRestrict to records inside a section of this kind
- --doc-idstringoptionalRestrict to one document
- --kindstringoptionalRestrict to one record kind: errors, param, invariant, instrument, checkbox, …
- --limitnumberoptionalPage size (1-100, default 20)
- --next-tokenstringoptionalPagination cursor
- --qstringoptionalSubstring match across the recognised slot values