Get Project
get_projectRetrieve details of the active ElmapiCMS project to view its configuration and settings.
Instructions
Get information about the current ElmapiCMS project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:35-35 (registration)Calls registerProjectTools to register the 'get_project' tool on the MCP server.
registerProjectTools(server, client); - src/tools/project.ts:4-17 (handler)Registers the 'get_project' tool and provides the async handler that calls client.get('/') to fetch project info from the ElmapiCMS API.
export function registerProjectTools( server: McpServer, client: ElmapiClient ): void { server.registerTool("get_project", { title: "Get Project", description: "Get information about the current ElmapiCMS project", }, async () => { const result = await client.get("/"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); } - src/client.ts:94-112 (helper)The ElmapiClient.get() method used by the handler to make a GET request to the API root endpoint.
async get( path: string, params?: Record<string, unknown> ): Promise<unknown> { const url = new URL(`${this.baseUrl}${path}`); if (params) { const flatPairs = this.flattenParams(params); for (const [key, value] of flatPairs) { url.searchParams.append(key, value); } } const response = await fetch(url.toString(), { method: "GET", headers: this.headers(), }); return this.handleResponse(response); }