Skip to main content
Glama

Revoke Document

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()
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool revokes public access, implying a mutation, but doesn't cover critical aspects like required permissions, whether the action is reversible, potential side effects (e.g., impact on shared links), or error conditions. This leaves significant gaps for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with security implications), lack of annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't address behavioral nuances, return values, or error handling, leaving the agent with inadequate information to use the tool safely and effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no information about parameters beyond what the schema provides. With 0% schema description coverage and two parameters (docId and workspaceId), the description doesn't explain what these IDs represent, their format, or why workspaceId is optional. This fails to compensate for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('revoke') and resource ('doc's public access'), making the tool's purpose understandable. However, it doesn't differentiate from sibling tools like 'affine_revoke_access_token' or 'publish_doc', which also deal with access control, leaving some ambiguity about when this specific tool should be used.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this is for revoking public access only (vs. other access types) or mention related tools like 'publish_doc' or 'affine_revoke_access_token' that might be alternatives. The description lacks context about prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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