{"openapi":"3.1.0","info":{"title":"RestDB (BYOK) API","version":"0.1.0","description":"RestDB (BYOK) lets an AI assistant read your own RestDB data through the RestDB API with a key you supply (restdb.io API key (read-only key recommended)). Read-only: 6 tools (get_database_meta, get_collection_meta, list_documents, count_documents, get_document, list_media_meta). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-restdb.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-restdb/docs"},"termsOfService":"https://connectorbay.com/byok-restdb/terms"},"servers":[{"url":"https://byok-restdb.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-restdb/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_database_meta":{"post":{"operationId":"get_database_meta","summary":"Get metadata of the database: its collections and their fields. Use for \"What collections does my restdb.io database hav","description":"Get metadata of the database: its collections and their fields. Use for \"What collections does my restdb.io database have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"}},"required":["db"],"title":"get_database_metaArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_collection_meta":{"post":{"operationId":"get_collection_meta","summary":"Get metadata of one collection: fields and field types. Use for \"What fields does the 'product' collection have in restd","description":"Get metadata of one collection: fields and field types. Use for \"What fields does the 'product' collection have in restdb.io\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"},"collection":{"description":"Collection name, for example 'product'.","maxLength":100,"title":"Collection","type":"string"}},"required":["db","collection"],"title":"get_collection_metaArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_documents":{"post":{"operationId":"list_documents","summary":"Query documents of a collection with a JSON query, sorting and paging; at most 1000 per call, default here 50. Use for \"","description":"Query documents of a collection with a JSON query, sorting and paging; at most 1000 per call, default here 50. Use for \"Show the 10 newest products in my restdb.io database\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"},"collection":{"description":"Collection name, for example 'product'.","maxLength":100,"title":"Collection","type":"string"},"q":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":"{}","description":"MongoDB-style JSON query, for example {\"price\":{\"$gt\":10}}; use {} for everything.","title":"Q"},"sort":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Field to sort by (default _id).","title":"Sort"},"dir":{"anyOf":[{"enum":["1","-1"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort direction: 1 ascending or -1 descending.","title":"Dir"},"max":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"Maximum documents to return (1 to 1000).","title":"Max"},"skip":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Documents to skip, for paging.","title":"Skip"},"metafields":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include internal fields such as _created and _version.","title":"Metafields"}},"required":["db","collection"],"title":"list_documentsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/count_documents":{"post":{"operationId":"count_documents","summary":"Count the documents of a collection that match a JSON query (no documents returned). Use for \"How many products cost mor","description":"Count the documents of a collection that match a JSON query (no documents returned). Use for \"How many products cost more than 10 in restdb.io\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"},"collection":{"description":"Collection name, for example 'product'.","maxLength":100,"title":"Collection","type":"string"},"q":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":"{}","description":"MongoDB-style JSON query, for example {\"price\":{\"$gt\":10}}; use {} for everything.","title":"Q"},"totals":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"description":"Return totals; fixed to true for this tool.","title":"Totals"},"count":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":true,"description":"Return only the count; fixed to true for this tool.","title":"Count"}},"required":["db","collection"],"title":"count_documentsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_document":{"post":{"operationId":"get_document","summary":"Get one document of a collection by its _id (an ObjectID). Use for \"Show restdb.io product 5602647c7f98025500000041\".","description":"Get one document of a collection by its _id (an ObjectID). Use for \"Show restdb.io product 5602647c7f98025500000041\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"},"collection":{"description":"Collection name, for example 'product'.","maxLength":100,"title":"Collection","type":"string"},"document_id":{"description":"The document's _id value (24 hex characters).","maxLength":40,"title":"Document Id","type":"string"}},"required":["db","collection","document_id"],"title":"get_documentArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_media_meta":{"post":{"operationId":"list_media_meta","summary":"List metadata (file name, size, type) of files in the database's media archive, optionally filtered by a JSON query. Use","description":"List metadata (file name, size, type) of files in the database's media archive, optionally filtered by a JSON query. Use for \"Which files are stored in my restdb.io media archive\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"db":{"description":"Your restdb.io database name, the first part of its address (for example 'rdb-simpledb' in rdb-simpledb.restdb.io).","maxLength":63,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Db","type":"string"},"q":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":"{}","description":"MongoDB-style JSON query on media metadata, for example {\"filesize\":{\"$gt\":30000}}.","title":"Q"}},"required":["db"],"title":"list_media_metaArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}