Skip to main content
Glama

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
NameRequiredDescriptionDefault
part_idNoOptional component identity from the catalog (e.g., 'BridgeDeck'). Omit to list all component types.

Implementation Reference

  • 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) }],
        };
      };
    }
  • 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)));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alex-gon/thegamecrafter-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server