get_site
Retrieve the currently authenticated Capsule account details including subdomain, display name, and URL. Diagnose which Capsule account this connector is connected to.
Instructions
Return the Capsule account this connector is currently authenticated against (subdomain, display name, URL). Diagnostic for 'which Capsule account is this?'. For the PAT owner's user identity, use get_current_user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/metadata.ts:76-79 (handler)The tool handler that makes a GET request to "/site" via capsuleGet and returns the site data.
export async function getSite(_input: z.infer<typeof getSiteSchema>) { const { data } = await capsuleGet<{ site: unknown }>("/site"); return data; } - src/tools/metadata.ts:74-74 (schema)Schema definition: no input parameters required (empty Zod object).
export const getSiteSchema = z.object({}); - src/server.ts:943-949 (registration)Registration of the "get_site" tool on the MCP server via the registerTool helper.
registerTool( server, "get_site", "Return the Capsule account this connector is currently authenticated against (subdomain, display name, URL). Diagnostic for 'which Capsule account is this?'. For the PAT owner's user identity, use get_current_user.", getSiteSchema, getSite, ); - src/server/register-tool.ts:39-59 (helper)Helper function that wraps the tool handler and registers it with the MCP server, formatting the result as JSON text content.
export function registerTool<Schema extends z.ZodObject<ZodRawShape>>( server: McpServer, name: string, description: string, schema: Schema, handler: (input: z.infer<Schema>) => Promise<unknown>, ): void { // Use the SDK config-form registerTool with the full Zod schema. The // deprecated shape overload rebuilds z.object(schema.shape), which drops // object-level refinements such as superRefine. const registerWithSchema = server.registerTool.bind(server) as ( toolName: string, config: { description: string; inputSchema: Schema }, callback: (input: z.infer<Schema>) => Promise<CallToolResult>, ) => void; registerWithSchema(name, { description, inputSchema: schema }, async (input) => { const result = await handler(input); return wrapAsText(result); }); } - src/capsule/client.ts:344-355 (helper)HTTP GET helper used by getSite to call the Capsule API's /site endpoint.
export async function capsuleGet<T>(path: string, params?: QueryParams): Promise<PagedResult<T>> { const token = getToken(); const url = buildUrl(path, params); const { res, cleanup } = await doFetch(url, { headers: baseHeaders(token) }); try { const data = await handleResponse<T>(res); const nextPage = parseNextPage(res.headers.get("Link")); return { data, nextPage }; } finally { cleanup(); } }