Get Workspace
get_workspaceRetrieve details of a specific workspace by providing its workspace ID.
Instructions
Get details of a specific workspace
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workspace ID |
Implementation Reference
- src/tools/workspaces.ts:156-175 (handler)The handler function that executes the 'get_workspace' tool logic. It sends a GraphQL query to fetch workspace details (id, public, enableAi, createdAt, permissions) and returns the result.
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 }); } }; - src/tools/workspaces.ts:177-187 (registration)Registers the 'get_workspace' tool on the MCP server with title 'Get Workspace', description, input schema (id: string), and the handler 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 ); - src/tools/workspaces.ts:182-184 (schema)The input schema for the 'get_workspace' tool: expects an 'id' parameter (string, described as 'Workspace ID') validated via Zod.
inputSchema: { id: z.string().describe("Workspace ID") } - src/toolSurface.ts:42-42 (helper)Declares 'get_workspace' in the ALL_TOOLS constant array, making it a known tool name in the system.
"get_workspace", - src/toolSurface.ts:132-132 (helper)Maps 'get_workspace' to its permission groups ['workspaces', 'workspaces.read', 'read'] in the TOOL_GROUPS configuration.
get_workspace: ["workspaces", "workspaces.read", "read"],