Skip to main content
Glama
ampcome-mcps

Square Model Context Protocol Server

by ampcome-mcps

get_service_info

Retrieve details about Square API services to understand available endpoints and data structures before making API calls.

Instructions

Get information about a Square API service. Call me before trying to get type info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesThe Square API service category (e.g., 'catalog', 'payments')

Implementation Reference

  • Handler function that takes a service name, capitalizes it, looks up the methods in serviceMethodsMap, extracts descriptions, and returns them as JSON. Handles errors by returning error content.
    async (params) => {
      try {
        const { service } = 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)}`);
        }
    
        // Create a map of method names to their descriptions
        const methodInfo = Object.entries(methods).reduce((acc, [methodName, info]) => {
          acc[methodName] = {
            description: info.description
          };
          return acc;
        }, {} as Record<string, { description: string }>);
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(methodInfo, null, 2)
          }]
        };
      } catch (err: any) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: err.message,
              details: err.errors || err.stack
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • server.ts:291-334 (registration)
    Registers the 'get_service_info' tool with MCP server, including name, description, input schema (service: string), and handler function.
    server.tool(
      "get_service_info",
      "Get information about a Square API service. Call me before trying to get type info",
      {
        service: z.string().describe("The Square API service category (e.g., 'catalog', 'payments')")
      },
      async (params) => {
        try {
          const { service } = 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)}`);
          }
    
          // Create a map of method names to their descriptions
          const methodInfo = Object.entries(methods).reduce((acc, [methodName, info]) => {
            acc[methodName] = {
              description: info.description
            };
            return acc;
          }, {} as Record<string, { description: string }>);
    
          return {
            content: [{
              type: "text",
              text: JSON.stringify(methodInfo, 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 schema for the tool input: a single 'service' parameter as string.
    {
      service: z.string().describe("The Square API service category (e.g., 'catalog', 'payments')")
    },
Behavior3/5

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

With no annotations provided, the description carries full burden. It states this is a 'Get' operation (implying read-only) and establishes a prerequisite relationship with 'get_type_info'. However, it doesn't disclose other behavioral traits like authentication requirements, rate limits, error conditions, or what format the information returns. The description adds some context but leaves significant behavioral aspects unspecified.

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. The first sentence states the core purpose, and the second provides crucial usage guidance. Every word earns its place with zero wasted text, making it front-loaded and efficient for an AI agent to parse.

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 has one parameter with full schema coverage but no annotations and no output schema, the description provides adequate purpose and usage guidance. However, it doesn't explain what information is returned or address behavioral aspects like error handling. For a simple read operation, it's minimally complete but lacks details about the return format that would be helpful without an output schema.

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 documents the single 'service' parameter with its type and description. The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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 the verb 'Get' and resource 'information about a Square API service', making the purpose evident. It distinguishes itself from 'get_type_info' by focusing on service-level information rather than type details. However, it doesn't specify what kind of information is retrieved (e.g., capabilities, endpoints, status), keeping it from a perfect score.

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 explicitly provides usage guidance: 'Call me before trying to get type info', indicating this tool should be used as a prerequisite for the sibling tool 'get_type_info'. This creates a clear workflow relationship and distinguishes it from 'make_api_request' by focusing on metadata rather than actual API calls.

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