get_component_sizes
Retrieve pixel dimensions and finished inches for game components to ensure correct image sizes before uploading artwork to The Game Crafter's print-on-demand platform.
Instructions
Get pixel dimensions (width, height, bleed, safe zone) and finished inches for TGC component types. Use this to determine correct image sizes before uploading artwork. No authentication required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| part_id | No | Optional component identity from the catalog (e.g., 'BridgeDeck'). Omit to list all component types. |
Implementation Reference
- src/tools/catalog.ts:18-59 (handler)The handler logic for the get_component_sizes tool, which retrieves product component dimensions (either for a specific component or all components).
export function handleGetComponentSizes(client: TgcClient) { return async (args: { part_id?: string }): Promise<CallToolResult> => { if (args.part_id) { const products = await client.getProducts(); const product = products.find((p) => p.identity === args.part_id); if (!product) { return { content: [ { type: "text", text: `No component found with ID "${args.part_id}".`, }, ], isError: true, }; } const sizes = [{ identity: product.identity, name: product.name, width_px: product.size?.pixels?.[0] ?? null, height_px: product.size?.pixels?.[1] ?? null, finished_inches: product.size?.finished_inches ?? null, }]; return { content: [{ type: "text", text: JSON.stringify(sizes, null, 2) }], }; } const products = await client.getProducts(); const sizes = products.map((p) => ({ identity: p.identity, name: p.name, width_px: p.size?.pixels?.[0] ?? null, height_px: p.size?.pixels?.[1] ?? null, finished_inches: p.size?.finished_inches ?? null, })); return { content: [{ type: "text", text: JSON.stringify(sizes, null, 2) }], }; }; } - src/schemas/tool-inputs.ts:106-112 (schema)The input schema definition for the get_component_sizes tool.
export const getComponentSizesInput = { part_id: safeId .optional() .describe( "Optional component identity from the catalog (e.g., 'BridgeDeck'). Omit to list all component types.", ), }; - src/index.ts:127-132 (registration)Registration of the get_component_sizes tool using its input schema and handler.
server.registerTool("get_component_sizes", { description: "Get pixel dimensions (width, height, bleed, safe zone) and finished inches for TGC component types. Use this to determine correct image sizes before uploading artwork. No authentication required.", inputSchema: schemas.getComponentSizesInput, annotations: { readOnlyHint: true }, }, withErrorHandling(handleGetComponentSizes(client)));