Skip to main content
Glama
bizino

BOS MCP Server

by bizino

bos_loyalty_tiers

Retrieve loyalty tier information to manage customer reward levels and eligibility for benefits.

Instructions

Get loyalty tier information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'bos_loyalty_tiers' tool. Makes a GET request to '/mcp/loyalty/tiers' to retrieve loyalty tier information. Takes no arguments (schema: {}).
    {
      name: 'bos_loyalty_tiers',
      description: 'Get loyalty tier information',
      schema: {},
      handler: async (_, client) => client.get('/mcp/loyalty/tiers'),
    },
  • The schema for 'bos_loyalty_tiers' is an empty object (no input parameters required).
    schema: {},
  • The 'loyaltyTools' array (which includes 'bos_loyalty_tiers') is exported and then imported in src/index.ts where all tools are registered with the MCP server via server.tool().
    export const loyaltyTools: McpTool[] = [
      {
        name: 'bos_loyalty_points_balance',
        description: 'Get loyalty points balance for customer',
        schema: { customer_id: { type: 'string' } },
        handler: async (args, client) => client.get(`/mcp/loyalty/${args.customer_id}/balance`),
      },
      {
        name: 'bos_loyalty_points_history',
        description: 'Get loyalty points transaction history',
        schema: {
          customer_id: { type: 'string' },
          page: { type: 'number', optional: true },
          page_size: { type: 'number', optional: true },
        },
        handler: async (args, client) => {
          const { customer_id, ...params } = args;
          return client.get(`/mcp/loyalty/${customer_id}/history`, params);
        },
      },
      {
        name: 'bos_loyalty_earn',
        description: 'Earn loyalty points',
        schema: {
          customer_id: { type: 'string' },
          points: { type: 'number' },
          order_id: { type: 'string', optional: true },
          description: { type: 'string', optional: true },
        },
        handler: async (args, client) => client.post('/mcp/loyalty/earn', args),
      },
      {
        name: 'bos_loyalty_redeem',
        description: 'Redeem loyalty points',
        schema: {
          customer_id: { type: 'string' },
          points: { type: 'number' },
          reward_id: { type: 'string', optional: true },
        },
        handler: async (args, client) => client.post('/mcp/loyalty/redeem', args),
      },
      {
        name: 'bos_loyalty_tiers',
        description: 'Get loyalty tier information',
        schema: {},
        handler: async (_, client) => client.get('/mcp/loyalty/tiers'),
      },
    ];
  • src/index.ts:55-76 (registration)
    All tools including 'bos_loyalty_tiers' are registered in the MCP server loop. The tools array is spread from imported categories and each tool is registered with server.tool().
    for (const tool of allTools) {
      const zodSchema = toZodSchema(tool.schema);
    
      server.tool(
        tool.name,
        tool.description,
        zodSchema.shape,
        async (args: any) => {
          try {
            const result = await tool.handler(args, client);
            return {
              content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (error: any) {
            return {
              content: [{ type: 'text' as const, text: JSON.stringify({ error: error.message || 'Unknown error' }) }],
              isError: true,
            };
          }
        }
      );
    }
  • The McpTool interface definition used to type the tool objects including 'bos_loyalty_tiers'.
    export interface McpTool {
      name: string;
      description: string;
      schema: Record<string, any>;
      handler: (args: any, client: BosApiClient) => Promise<any>;
    }
    
    export interface ToolCategory {
      name: string;
      tools: McpTool[];
    }
    
    /**
     * Convert our simple schema format to Zod schema for MCP SDK.
     * Input: { field: { type: 'string', optional: true, description: '...' } }
     * Output: z.object({ field: z.string().optional().describe('...') })
     */
    export function toZodSchema(schema: Record<string, any>): z.ZodObject<any> {
      const shape: Record<string, z.ZodTypeAny> = {};
    
      for (const [key, def] of Object.entries(schema)) {
        let field: z.ZodTypeAny;
    
        switch (def.type) {
          case 'number':
            field = z.number();
            break;
          case 'boolean':
            field = z.boolean();
            break;
          case 'array':
            field = z.array(z.any());
            break;
          case 'object':
            field = z.record(z.any());
            break;
          case 'string':
          default:
            if (def.enum) {
              field = z.enum(def.enum);
            } else {
              field = z.string();
            }
            break;
        }
    
        if (def.description) {
          field = field.describe(def.description);
        }
    
        if (def.optional) {
          field = field.optional();
        }
    
        shape[key] = field;
      }
    
      return z.object(shape);
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It only says 'Get loyalty tier information', giving no details about read-only nature, rate limits, or what happens if called without prior context. The agent gets minimal insight into side effects or constraints.

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

Conciseness4/5

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

A single, clear sentence. It is concise but not overly terse; however, it could be slightly more informative without becoming verbose.

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 no parameters and no output schema, the description could be more complete by specifying what 'tier information' entails (e.g., tier names, thresholds, benefits). It also fails to differentiate from overlapping sibling tools. Thus it is adequate but has gaps.

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

Parameters4/5

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

The input schema has zero parameters with 100% coverage, so description need not add parameter details. Baseline 4 applies. The description adds no parameter information but none is needed.

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 'Get loyalty tier information' clearly states the tool retrieves loyalty tier data, matching the name. However, it does not distinguish from sibling tools like bos_customer_loyalty_summary which may also return tier info, so clarity is good but not perfect.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. There is no mention of context, such as when to prefer this over bos_loyalty_points_balance or bos_customer_loyalty_summary. This leaves the agent without explicit selection criteria.

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/bizino/bos-mcp'

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