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')")
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool's prerequisite nature, which is valuable context, but doesn't describe what 'type information' includes, potential error conditions, or response format. For a tool with no annotations, this leaves significant behavioral 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 extremely concise with just two sentences, both of which earn their place by stating the purpose and critical usage guideline. It's front-loaded with the core function and wastes no words, making it highly efficient for agent comprehension.

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?

Given the tool's complexity (prerequisite for API calls), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'type information' entails, how it's used with make_api_request, or what the return values look like. While it covers purpose and usage well, it leaves too many contextual gaps for a tool in this role.

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 description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific details beyond what the schema provides, such as examples of valid service/method combinations or constraints. This meets the baseline for high schema coverage.

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 type information') and resource ('for a Square API method'), and distinguishes it from sibling tools by explicitly mentioning its prerequisite role before calling make_api_request. It uses precise language that leaves no ambiguity about its function.

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 usage guidance by stating 'You must call this before calling the make_api_request tool,' which clearly defines when to use this tool versus its sibling. It establishes a clear workflow dependency, making it easy for an agent to understand its contextual role.

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/ampcome-mcps/square-mcp'

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