Skip to main content
Glama
square

Square Model Context Protocol Server

Official
by square

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 for the 'get_service_info' tool. It retrieves method information for a given Square API service and returns descriptions of available methods.
    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
        };
      }
    }
  • Input schema for the 'get_service_info' tool, defining the 'service' parameter using Zod.
    {
      service: z.string().describe("The Square API service category (e.g., 'catalog', 'payments')")
    },
  • server.ts:291-334 (registration)
    Registration of the 'get_service_info' MCP tool using server.tool, including description, schema, and inline handler.
    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
          };
        }
      }
    );
Behavior2/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 only states what the tool does without mentioning any behavioral traits such as rate limits, authentication needs, error handling, or response format. This leaves significant gaps for an AI agent to understand how to interact with it effectively.

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 and front-loaded, consisting of two short sentences that directly convey the tool's purpose and usage guideline without any wasted words. Every sentence earns its place by adding essential information.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns structured data about API services. It doesn't explain what information is returned, the format, or any constraints, leaving the AI agent with insufficient context to use the tool effectively beyond basic invocation.

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, fully documenting the single required parameter 'service' with its type and example values. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for adequate but not enhanced coverage.

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 tool's purpose with a specific verb ('Get information') and resource ('Square API service'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_type_info' beyond the suggestion to call it first, which slightly limits distinction.

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 provides clear usage guidance by stating 'Call me before trying to get type info,' which implies a prerequisite relationship with 'get_type_info.' It doesn't explicitly mention when not to use it or alternatives like 'make_api_request,' but the context is sufficient for basic decision-making.

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

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