Skip to main content
Glama

revoke_doc

Remove public access to a specific document in an AFFiNE workspace by specifying the docId using the GraphQL API.

Instructions

Revoke a doc's public access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYes
workspaceIdNo

Implementation Reference

  • The main handler function that executes the revoke_doc tool logic by sending a GraphQL mutation to revoke public access for the specified document.
    const revokeDocHandler = async (parsed: { workspaceId?: string; docId: string }) => { const workspaceId = parsed.workspaceId || defaults.workspaceId; if (!workspaceId) { throw new Error("workspaceId is required. Provide it as a parameter or set AFFINE_WORKSPACE_ID in environment."); } const mutation = `mutation RevokeDoc($workspaceId:String!,$docId:String!){ revokePublicDoc(workspaceId:$workspaceId, docId:$docId){ id workspaceId public } }`; const data = await gql.request<{ revokePublicDoc: any }>(mutation, { workspaceId, docId: parsed.docId }); return text(data.revokePublicDoc); };
  • Registration of the 'revoke_doc' tool, including its input schema and reference to the handler function.
    server.registerTool( "revoke_doc", { title: "Revoke Document", description: "Revoke a doc's public access.", inputSchema: { workspaceId: z.string().optional(), docId: z.string() } }, revokeDocHandler as any );
  • Input schema definition for the revoke_doc tool using Zod for validation.
    inputSchema: { workspaceId: z.string().optional(), docId: z.string() }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DAWNCR0W/affine-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server