{"openapi":"3.1.1","info":{"title":"NUDISCO API","version":"1.0.0","description":"Read-only discovery, search and retrieval for a public NUDISCO snapshot. REST needs no credentials. Search has a shared per-instance quota across REST and MCP. Hosting limits also apply. Search reads the bundled snapshot and does not fetch user-supplied URLs."},"servers":[{"url":"/"}],"security":[],"paths":{"/api/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"Discover features, relative endpoint paths and corpus coverage","responses":{"200":{"description":"Capability flags and snapshot coverage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capabilities"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/resources":{"get":{"operationId":"listResources","summary":"List selected public resources and their canonical URLs","responses":{"200":{"description":"Public resource directory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Directory"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/search":{"get":{"operationId":"searchRecords","summary":"Find records in the snapshot using a case-insensitive literal query","description":"An omitted edition searches both editions. No matches returns 200 with an empty results array. Supply each query parameter at most once. Each service instance allows 120 valid searches per 60 seconds across all callers of REST and MCP. On 429 wait the number of seconds in Retry-After.","parameters":[{"name":"q","in":"query","required":true,"description":"Search term of up to 120 UTF-16 code units. ASCII controls and DEL are rejected. Surrounding whitespace is trimmed and the remaining term must be nonempty.","schema":{"type":"string","minLength":1,"maxLength":120}},{"$ref":"#/components/parameters/SearchEdition"},{"name":"limit","in":"query","description":"A base-10 integer from 1 to 25 without leading zeros.","schema":{"type":"integer","minimum":1,"maximum":25,"default":10}}],"responses":{"200":{"description":"Matches with canonical source URLs and snippets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Search"}}}},"400":{"$ref":"#/components/responses/Error"},"429":{"description":"The shared search quota for this service instance has been reached.","headers":{"Retry-After":{"description":"Seconds until more searches can run.","schema":{"type":"integer","minimum":1,"maximum":60}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/records/{id}":{"get":{"operationId":"getRecord","summary":"Read one public record in the chosen edition","parameters":[{"name":"id","in":"path","required":true,"description":"Percent-encode the record ID as one UTF-8 path segment. Up to 700 UTF-16 code units. Slashes, backslashes, ASCII control characters, DEL, and whole dot segments are invalid.","schema":{"type":"string","minLength":1,"maxLength":700}},{"name":"edition","in":"query","schema":{"type":"string","enum":["regular","original"],"default":"regular"}}],"responses":{"200":{"description":"Selected record. Text can be null when the snapshot contains metadata only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/openapi.json":{"get":{"operationId":"getOpenApi","summary":"Read this OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 specification.","content":{"application/json":{"schema":{"type":"object","required":["openapi","info","paths"]}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/mcp":{"post":{"operationId":"postMcp","summary":"Send one MCP JSON-RPC message","description":"Stateless Streamable HTTP. MCP 2026-07-28 uses per-request protocol metadata and supports server/discover. MCP 2025-11-25 clients use initialize. Both support tool discovery and calls. Send application/json and accept both application/json and text/event-stream. No standalone SSE stream is offered.","requestBody":{"required":true,"description":"One JSON-RPC message. Body limit 16 KiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RpcRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/Rpc"},"202":{"description":"Notification accepted. The response body is empty."},"default":{"$ref":"#/components/responses/Rpc"}}}}},"components":{"parameters":{"SearchEdition":{"name":"edition","in":"query","description":"Optional edition filter.","schema":{"$ref":"#/components/schemas/Edition"}}},"responses":{"Error":{"description":"A REST error. Invalid input returns 400, missing routes or records 404, unsupported methods 405, oversized request targets 414, and unexpected failures 500.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Rpc":{"description":"The MCP transport returns JSON-RPC results or errors. See the MCP client instructions for transport and protocol headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RpcResponse"}}}}},"schemas":{"Edition":{"type":"string","enum":["regular","original"]},"SourceUrl":{"type":"string","format":"uri","pattern":"^https://"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"RecordIdentity":{"type":"object","required":["id","title","edition","url"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"edition":{"$ref":"#/components/schemas/Edition"},"url":{"$ref":"#/components/schemas/SourceUrl"}}},"Record":{"allOf":[{"$ref":"#/components/schemas/RecordIdentity"},{"type":"object","required":["text"],"properties":{"text":{"type":["string","null"]}}}]},"Hit":{"allOf":[{"$ref":"#/components/schemas/RecordIdentity"},{"type":"object","required":["snippet"],"properties":{"snippet":{"type":"string"}}}]},"Search":{"type":"object","required":["query","edition","limit","truncated","results"],"properties":{"query":{"type":"string"},"edition":{"enum":["regular","original",null]},"limit":{"type":"integer","minimum":1,"maximum":25},"truncated":{"type":"boolean"},"results":{"type":"array","maxItems":25,"items":{"$ref":"#/components/schemas/Hit"}}}},"Directory":{"type":"object","required":["site_url","machine_entrance_url","resources"],"properties":{"site_url":{"$ref":"#/components/schemas/SourceUrl"},"machine_entrance_url":{"$ref":"#/components/schemas/SourceUrl"},"resources":{"type":"array","items":{"type":"object","required":["id","title","type","url"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"url":{"$ref":"#/components/schemas/SourceUrl"}}}}}},"Capabilities":{"type":"object","required":["name","schema_version","features","endpoints","corpus"],"properties":{"name":{"type":"string"},"schema_version":{"const":1},"features":{"type":"object","required":["discovery","search","records","mcp","ask"],"properties":{"discovery":{"type":"boolean"},"search":{"type":"boolean"},"records":{"type":"boolean"},"mcp":{"type":"boolean"},"ask":{"const":false}}},"endpoints":{"type":"object","required":["capabilities","resources","search","record_template","openapi","mcp"],"additionalProperties":{"type":"string"}},"corpus":{"type":"object","required":["records","regular","original","with_rss_text","coverage"],"properties":{"records":{"type":"integer","minimum":0},"regular":{"type":"integer","minimum":0},"original":{"type":"integer","minimum":0},"with_rss_text":{"type":"integer","minimum":0},"coverage":{"type":"string"},"freshness":{"type":"object","description":"Snapshot serving this instance. Local runs read a file. A hosted Worker serves its last validated release while refreshing.","properties":{"source":{"enum":["local-file","bundled","original","edge-cache"]},"last_verified_at":{"type":["string","null"],"format":"date-time"},"last_refresh_failed":{"type":"boolean"},"freshness_seconds":{"type":"integer"},"retry_seconds":{"type":"integer"}}}}}}},"RpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["integer","string"]},"method":{"type":"string"},"params":{"type":"object"},"result":false,"error":false}},"RpcResponse":{"type":"object","required":["jsonrpc"],"oneOf":[{"required":["id","result"]},{"required":["error"]}],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["integer","string","null"]},"result":{"type":"object"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}}}}}}}}