Skip to main content
Glama

Get Workspace

get_workspace

Retrieve detailed information about a specific AFFiNE workspace using its unique ID, enabling efficient workspace management and operations.

Instructions

Get details of a specific workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkspace ID

Implementation Reference

  • The main handler function for the 'get_workspace' tool. It takes a workspace ID, executes a GraphQL query to fetch workspace details including id, public status, AI enablement, creation date, and permissions, then returns the data or an error.
    const getWorkspaceHandler = async ({ id }: { id: string }) => {
      try {
        const query = `query GetWorkspace($id: String!) { 
          workspace(id: $id) { 
            id 
            public 
            enableAi 
            createdAt
            permissions { 
              Workspace_Read 
              Workspace_CreateDoc 
            } 
          } 
        }`;
        const data = await gql.request<{ workspace: any }>(query, { id });
        return text(data.workspace);
      } catch (error: any) {
        return text({ error: error.message });
      }
    };
  • Registers the 'get_workspace' tool with the MCP server, specifying the tool name, title, description, input schema requiring a string 'id', and linking to the getWorkspaceHandler function.
    server.registerTool(
      "get_workspace",
      {
        title: "Get Workspace",
        description: "Get details of a specific workspace",
        inputSchema: { 
          id: z.string().describe("Workspace ID") 
        }
      },
      getWorkspaceHandler as any
    );
  • Input schema definition for the tool using Zod: requires a string 'id' parameter for the workspace ID.
    inputSchema: { 
      id: z.string().describe("Workspace ID") 
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get details' which implies a read-only operation, but doesn't disclose behavioral traits such as authentication requirements, error handling, rate limits, or what specific details are returned. For a tool with no annotation coverage, this leaves significant gaps in understanding its 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 that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the essential action and resource, making it easy for an agent to parse quickly. Every word earns its place, with no redundancy or fluff.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'details' are returned, error conditions, or authentication needs. For a tool that retrieves data, the agent needs more context about the response format and operational constraints to use it effectively.

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

Parameters3/5

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

The description adds no parameter semantics beyond what the input schema provides. With 100% schema description coverage, the schema already documents the single parameter 'id' as 'Workspace ID'. The description doesn't elaborate on format, examples, or constraints, so it meets the baseline for adequate but unhelpful parameter 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 verb 'Get' and the resource 'details of a specific workspace', making the purpose evident. It distinguishes from sibling tools like 'list_workspaces' by specifying retrieval of a single workspace rather than listing multiple. However, it doesn't explicitly contrast with 'get_doc' or other get operations, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like needing a workspace ID, nor does it differentiate from similar tools like 'get_doc' or 'list_workspaces'. Without any usage context or exclusions, the agent must infer when this tool is appropriate.

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