{"openapi":"3.1.0","info":{"title":"Sanity (BYOK) API","version":"0.1.0","description":"Sanity (BYOK) lets an AI assistant read your own Sanity data through the Sanity API with a key you supply (API token with read access (Viewer)). Read-only: 9 tools (run_groq_query, list_document_types, count_documents, list_documents, search_documents, list_recently_updated, get_document, get_dataset_summary, get_document_uncached). The BYOK key travels with each request, is used for that one...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-sanity.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-sanity/docs"},"termsOfService":"https://connectorbay.com/byok-sanity/terms"},"servers":[{"url":"https://byok-sanity.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-sanity/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/run_groq_query":{"post":{"operationId":"run_groq_query","summary":"Run a read-only GROQ query against a dataset, for example *[_type == 'post'][0...10]{title}. Returns the query result an","description":"Run a read-only GROQ query against a dataset, for example *[_type == 'post'][0...10]{title}. Returns the query result and server time. GET-length limits do not apply. Use for \"Run the GROQ query *[_type == 'post'][0...5]{title} on my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"groq":{"description":"The GROQ query text, for example \"*[_type == 'post'][0...10]{_id, title}\".","maxLength":4000,"title":"Groq","type":"string"}},"required":["project_id","dataset","groq"],"title":"run_groq_queryArguments","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_document_types":{"post":{"operationId":"list_document_types","summary":"List the distinct document types (_type values) present in a dataset. Use for \"What document types are in my Sanity data","description":"List the distinct document types (_type values) present in a dataset. Use for \"What document types are in my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"}},"required":["project_id","dataset"],"title":"list_document_typesArguments","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 one type in a dataset (drafts included). Use for \"How many posts are in my Sanity dataset\".","description":"Count the documents of one type in a dataset (drafts included). Use for \"How many posts are in my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"type":{"description":"Document type name (the _type value), for example 'post'.","maxLength":100,"title":"Type","type":"string"}},"required":["project_id","dataset","type"],"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/list_documents":{"post":{"operationId":"list_documents","summary":"List documents of one type, most recently updated first, with id, type, dates, title (or name) and slug. Use start and e","description":"List documents of one type, most recently updated first, with id, type, dates, title (or name) and slug. Use start and end as a slice [start, end). Use for \"List the latest posts in my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"type":{"description":"Document type name (the _type value), for example 'post'.","maxLength":100,"title":"Type","type":"string"},"start":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"First index of the slice (0 for the first).","title":"Start"},"end":{"anyOf":[{"maximum":100100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Index after the last item of the slice (start plus the page size, at most start plus 100).","title":"End"}},"required":["project_id","dataset","type"],"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/search_documents":{"post":{"operationId":"search_documents","summary":"Search documents whose title or name matches a word or prefix (GROQ match, e.g. 'launch*'), newest first. Use for \"Find ","description":"Search documents whose title or name matches a word or prefix (GROQ match, e.g. 'launch*'), newest first. Use for \"Find Sanity documents about onboarding\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"term":{"description":"Word or prefix to match in title or name, for example 'onboard*'.","maxLength":100,"title":"Term","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many documents to return (1 to 100).","title":"Limit"}},"required":["project_id","dataset","term"],"title":"search_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/list_recently_updated":{"post":{"operationId":"list_recently_updated","summary":"List the most recently updated documents of any type (system documents excluded) with id, type, dates, title and slug. U","description":"List the most recently updated documents of any type (system documents excluded) with id, type, dates, title and slug. Use for \"What content changed most recently in my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many documents to return (1 to 100).","title":"Limit"}},"required":["project_id","dataset"],"title":"list_recently_updatedArguments","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 by its _id from the query API (cached, may lag a few seconds). Draft documents have ids starting with '","description":"Get one document by its _id from the query API (cached, may lag a few seconds). Draft documents have ids starting with 'drafts.'. Use for \"Show the Sanity document with id post1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"id":{"description":"The document's _id, for example 'post1' or 'drafts.post1'.","maxLength":200,"title":"Id","type":"string"}},"required":["project_id","dataset","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/get_dataset_summary":{"post":{"operationId":"get_dataset_summary","summary":"Count all documents, draft documents and distinct types in a dataset. Use for \"How big is my Sanity dataset\".","description":"Count all documents, draft documents and distinct types in a dataset. Use for \"How big is my Sanity dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"}},"required":["project_id","dataset"],"title":"get_dataset_summaryArguments","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_uncached":{"post":{"operationId":"get_document_uncached","summary":"Fetch one document by id straight from the backend, bypassing the cache (use sparingly). Use for \"Get the latest uncache","description":"Fetch one document by id straight from the backend, bypassing the cache (use sparingly). Use for \"Get the latest uncached version of Sanity document post1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Your Sanity project ID (a short lowercase code such as 'abc12def'); the part before .api.sanity.io.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Project Id","type":"string"},"dataset":{"description":"Dataset name, for example 'production'.","maxLength":64,"title":"Dataset","type":"string"},"document_id":{"description":"The document id, for example 'post1' or 'drafts.post1'.","maxLength":500,"title":"Document Id","type":"string"},"include_all_versions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to include draft and release versions of the documents.","title":"Include All Versions"}},"required":["project_id","dataset","document_id"],"title":"get_document_uncachedArguments","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}}}}