Skip to main content
Glama
ampcome-mcps

Square Model Context Protocol Server

by ampcome-mcps

get_type_info

Retrieve API method specifications for Square services to ensure proper data formatting before making requests.

Instructions

Get type information for a Square API method. You must call this before calling the make_api_request tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesThe Square API service category (e.g., 'catalog', 'payments')
methodYesThe API method to call (e.g., 'list', 'create')

Implementation Reference

  • server.ts:240-288 (registration)
    Registration of the 'get_type_info' MCP tool, including name, description, input schema, and inline handler function.
    server.tool(
      "get_type_info",
      "Get type information for a Square API method. You must call this before calling the make_api_request tool.",
      {
        service: z.string().describe("The Square API service category (e.g., 'catalog', 'payments')"),
        method: z.string().describe("The API method to call (e.g., 'list', 'create')")
      },
      async (params) => {
        try {
          const { service, method } = params;
          const serviceName = service.charAt(0).toUpperCase() + service.slice(1);
          
          const methods = serviceMethodsMap[serviceName];
          if (!methods) {
            throw new Error(`Invalid service: ${service}. Available services: ${JSON.stringify(Object.keys(serviceMethodsMap), null, 2)}`);
          }
    
          if (!methods[method]) {
            throw new Error(`Invalid method ${method} for service ${service}. Available methods: ${JSON.stringify(Object.keys(methods), null, 2)}`);
          }
    
          const methodInfo = methods[method];
          const requestTypeName = methodInfo.requestType;
          
          const typeInfo = typeMap[requestTypeName];
          if (!typeInfo) {
            throw new Error(`Type information not found for ${requestTypeName}`);
          }
    
          return {
            content: [{
              type: "text",
              text: JSON.stringify(typeInfo, null, 2)
            }]
          };
        } catch (err: any) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                error: err.message,
                details: err.errors || err.stack
              }, null, 2)
            }],
            isError: true
          };
        }
      }
    );
  • Executes the logic for 'get_type_info': capitalizes service name, retrieves method info from serviceMethodsMap, fetches type info from typeMap using requestType, and returns as JSON text content.
    async (params) => {
      try {
        const { service, method } = params;
        const serviceName = service.charAt(0).toUpperCase() + service.slice(1);
        
        const methods = serviceMethodsMap[serviceName];
        if (!methods) {
          throw new Error(`Invalid service: ${service}. Available services: ${JSON.stringify(Object.keys(serviceMethodsMap), null, 2)}`);
        }
    
        if (!methods[method]) {
          throw new Error(`Invalid method ${method} for service ${service}. Available methods: ${JSON.stringify(Object.keys(methods), null, 2)}`);
        }
    
        const methodInfo = methods[method];
        const requestTypeName = methodInfo.requestType;
        
        const typeInfo = typeMap[requestTypeName];
        if (!typeInfo) {
          throw new Error(`Type information not found for ${requestTypeName}`);
        }
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(typeInfo, null, 2)
          }]
        };
      } catch (err: any) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: err.message,
              details: err.errors || err.stack
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Zod input schema for the 'get_type_info' tool, requiring 'service' and 'method' strings.
    {
      service: z.string().describe("The Square API service category (e.g., 'catalog', 'payments')"),
      method: z.string().describe("The API method to call (e.g., 'list', 'create')")
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must cover behavior. It states it 'gets type information' but does not disclose whether it is read-only, any side effects, or what the response structure looks like, leaving significant 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?

Two sentences, front-loaded with purpose and a clear usage instruction. Every sentence adds value with no wasted words.

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

Completeness3/5

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

For a simple prerequisite tool, the description is acceptable but lacks detail on return values and behavioral context. Given no output schema, the agent might need more info to effectively use the result.

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?

Schema coverage is 100%, with both parameters described. The description adds no additional information beyond the schema, so baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states it gets type information for a Square API method, and the prerequisite relationship with make_api_request distinguishes it from sibling tools, though it does not specify what 'type information' entails.

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

Usage Guidelines4/5

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

The description explicitly instructs the agent to call this tool before make_api_request, providing clear usage context. However, it does not mention when not to use it or alternatives.

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

Deploy Server

Other Tools