Get Entry
get_entryRetrieve a specific content entry from a collection using its UUID. Specify the collection slug and optionally a locale.
Instructions
Get a single content entry by UUID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_slug | Yes | The collection slug | |
| uuid | Yes | The entry UUID | |
| locale | No | Locale code |
Implementation Reference
- src/tools/content.ts:101-109 (handler)The handler function for the 'get_entry' tool. It extracts collection_slug, uuid, and optional locale from the input, builds query parameters, makes a GET request to /{collection_slug}/{uuid}, and returns the result as JSON text.
}, async ({ collection_slug, uuid, locale }) => { const params: Record<string, string> = {}; if (locale) params.locale = locale; const result = await client.get(`/${collection_slug}/${uuid}`, params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/tools/content.ts:96-100 (schema)The input schema for 'get_entry' using Zod: requires collection_slug (string) and uuid (string), with optional locale (string).
inputSchema: { collection_slug: z.string().describe("The collection slug"), uuid: z.string().describe("The entry UUID"), locale: z.string().optional().describe("Locale code"), }, - src/tools/content.ts:92-109 (registration)The full registration block for 'get_entry' using server.registerTool(), including title, description, input schema, and handler callback.
// ── get_entry ───────────────────────────────────────────────────── server.registerTool("get_entry", { title: "Get Entry", description: "Get a single content entry by UUID", inputSchema: { collection_slug: z.string().describe("The collection slug"), uuid: z.string().describe("The entry UUID"), locale: z.string().optional().describe("Locale code"), }, }, async ({ collection_slug, uuid, locale }) => { const params: Record<string, string> = {}; if (locale) params.locale = locale; const result = await client.get(`/${collection_slug}/${uuid}`, params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/index.ts:38-38 (registration)The entry point that calls registerContentTools(server, client), which registers all content tools including 'get_entry'.
registerContentTools(server, client); - src/client.ts:94-112 (helper)The ElmapiClient.get() method used by the handler to make the HTTP GET request to the API 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); }