Skip to main content
Glama

get_component_sizes

Read-only

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)));
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds valuable context beyond this by specifying that 'No authentication required,' which is not covered by annotations and is crucial for usage. However, it doesn't disclose other behavioral traits like rate limits, error handling, or response format, leaving some gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by usage context and authentication note. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one optional parameter, read-only operation) and good annotations, the description is mostly complete. It covers purpose, usage, and authentication needs. However, without an output schema, it doesn't explain return values (e.g., format of dimensions), which is a minor gap in context for a sizing tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'part_id' well-documented in the schema itself. The description does not add any additional meaning or examples beyond what the schema provides (e.g., it doesn't elaborate on 'TGC component types' or 'finished inches'), so it meets the baseline for high schema coverage without compensating with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get pixel dimensions... and finished inches') and resource ('TGC component types'), distinguishing it from siblings like get_component_details (which likely provides other metadata) or get_game_catalog (broader scope). It explicitly mentions the purpose ('determine correct image sizes before uploading artwork'), making the tool's role unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('before uploading artwork') and distinguishes it from alternatives by specifying its focus on dimensions for TGC components. It also clarifies when not to use it by implying it's for sizing information only, not for other component details handled by siblings like get_component_details.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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