cms_get_page
Retrieve a CMS page by its ID to access page content and settings.
Instructions
Get a CMS page by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | No | Action parameters as a JSON object |
Implementation Reference
- src/actions/cms.ts:56-68 (handler)Handler function that validates params with CmsGetPageSchema, then calls Magento REST API GET /V1/cmsPage/{page_id} with optional store_view_code scope.
// ── Get Page ────────────────────────────────────────────────────────── { name: 'cms.get_page', description: 'Get a CMS page by ID.', riskTier: RiskTier.Safe, requiresAuth: true, handler: async (params: Record<string, unknown>, context: ActionContext) => { const validated = CmsGetPageSchema.parse(params); const client = context.getClient(); const storeCode = validated.scope?.store_view_code; return await client.get(`/V1/cmsPage/${validated.page_id}`, undefined, storeCode); }, }, - src/validation/schemas.ts:176-179 (schema)Zod validation schema requiring page_id (integer) and optional scope (website_code, store_code, store_view_code, or global).
export const CmsGetPageSchema = z.object({ page_id: z.number().int(), scope: StoreScopeSchema.optional(), }); - src/actions/cms.ts:27-28 (registration)The tool is defined as an ActionDefinition in the array returned by createCmsActions(), with name 'cms.get_page'.
return [ // ── Search Pages ────────────────────────────────────────────────────── - src/index.ts:75-82 (registration)The tool 'cms.get_page' is registered as an MCP tool via the SDK's mcpServer.tool(), with its name converted to 'cms_get_page' (dots to underscores).
// Register each action as an MCP tool for (const action of allActions) { // Convert dots to underscores for MCP tool names (e.g. "auth.login" -> "auth_login") const toolName = action.name.replace(/\./g, '_'); mcpServer.tool( toolName, action.description,