Skip to content
GitmoapAPIBeta
Knowledgespecs
GET/repositories/{repo_id}/specs/ids

List identifier declarations with how often the corpus cites each

list_spec_ids
  • tree:read
    A token needs the tree:read scope: Browse repository trees and blobsGranted by mcp_agent, mcp_agent_write, read_api, read_repository, write_api, write_repository.Every operation this scope unlocks
  • Single-resource

    x-gitmoap-isolation: {"kind":"single_or_self_scoped"}

  • Paginated
    Pass the next_token a page returns to get the next one.

Every identifier the documents declare — rules, tenets, principles, invariants and other named identifiers — in family then identifier order, each with how often the corpus cites it, so an identifier nobody cites stands out. Filter by family, by whether it has been retired or moved, or by a substring of the identifier. 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
  • id_kindstringoptionalRestrict to one family: rule, tenet, principle, invariant, dogfooding, generic
  • tombstonedbooleanoptionalSelect only retired/moved declarations, or only live ones
  • qstringoptionalSubstring match on the identifier itself
  • limitinteger · int32optionalPage size (1-100, default 20)
  • next_tokenstringoptionalPagination cursor

Responses

200A page of declarations in (kind, id) orderapplication/json
  • itemsarray of object
    • citationsinteger · int64
    • idstring
    • kindSpecIdKindruletenetprincipleinvariantdogfoodinggenericWhich identifier family a declaration belongs to.
    • scopestring
    • anchorstring or nulloptional
    • doc_idstring or nulloptionalThe document declaring the identifier. Absent when that document has been removed; the identifier is kept and cannot be reused.
    • lineinteger · int32 or nulloptional
    • titlestring or nulloptional
    • tombstonestring or nulloptional
  • next_tokenstring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"citations": 8,
"id": "id-4d93",
"kind": "rule",
"scope": "scope-a8cf"
},
{
"citations": 76,
"id": "id-a192",
"kind": "rule",
"scope": "scope-2efb"
}
],
"next_token": "next-token-c55a"
}
400Unknown identifier kind 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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-10e3",
"message": "Draw the region map from operation density"
}
}
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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-0d42",
"message": "Label every synthesized example"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
  • FORBIDDENYou are signed in but may not do this here; reason names the permission or the rule that refused it
  • INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs; required_scope names 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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-1cb8",
"message": "Draw the region map from operation density"
}
}
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 reason or code.
    • fieldstring or nulloptionalOn a 400 that 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 on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): 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-326d",
"message": "Draw the region map from operation density"
}
}

CLI

gitmoap specs list-spec-ids

  • --repo-ididThe repository whose corpus is indexed (id or owner/repo path)
  • --id-kindstringoptionalRestrict to one family: rule, tenet, principle, invariant, dogfooding, generic
  • --limitnumberoptionalPage size (1-100, default 20)
  • --next-tokenstringoptionalPagination cursor
  • --qstringoptionalSubstring match on the identifier itself
  • --tombstonedflagoptionalSelect only retired/moved declarations, or only live ones

Used in these guides