Skip to main content
Glama
bizino

BOS MCP Server

by bizino

boscli_cache_clear

Clears BOS application caches to fix loading errors or outdated data. Supports clearing all, config, route, view, or cache types.

Instructions

Clear BOS application caches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNo

Implementation Reference

  • Handler function for boscli_cache_clear tool. Calls POST /boscli/cache/clear on the BOS API client, passing an optional 'type' argument (defaults to 'all').
    {
      name: 'boscli_cache_clear',
      description: 'Clear BOS application caches',
      schema: {
        type: { type: 'string', enum: ['all', 'config', 'route', 'view', 'cache'], optional: true },
      },
      handler: async (args, client) => client.post('/boscli/cache/clear', { type: args.type || 'all' }),
    },
  • Input schema for boscli_cache_clear: optional 'type' parameter with enum values ['all', 'config', 'route', 'view', 'cache'].
    schema: {
      type: { type: 'string', enum: ['all', 'config', 'route', 'view', 'cache'], optional: true },
    },
  • src/index.ts:9-31 (registration)
    cacheTools imported from ./tools/cache.js and spread into allTools array at line 31 in the main MCP server entry point (src/index.ts). Also imported in src/stdio.ts (line 9, 31) and src/http.ts (line 10, 31).
    import { cacheTools } from './tools/cache.js';
    import { systemTools } from './tools/system.js';
    import {
      productTools,
      orderTools,
      cartTools,
      customerTools,
      inventoryTools,
      voucherTools,
      loyaltyTools,
      storeTools,
      checkoutTools,
      promotionTools,
      engagementTools,
    } from './tools/bos.js';
    import { smartTools } from './tools/smart.js';
    import { erpTools } from './tools/erp.js';
    
    const allTools: McpTool[] = [
      ...healthTools,
      ...moduleTools,
      ...routeTools,
      ...cacheTools,
  • src/index.ts:54-76 (registration)
    Generic registration loop: all tools (including boscli_cache_clear) are registered to the McpServer using server.tool() with their name, description, Zod schema, and a wrapper handler that calls tool.handler(args, client).
    // Register all tools with proper Zod schemas
    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,
            };
          }
        }
      );
    }
  • toZodSchema helper converts the simple schema format (like boscli_cache_clear's schema with enum and optional) into a Zod schema for MCP SDK registration.
    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 provided, the description carries full burden to disclose behavior. It only states 'Clear caches' without explaining that it is destructive, any side effects, or required permissions.

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

Conciseness3/5

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

The description is very short (5 words) and front-loaded, but it sacrifices necessary details. It is concise but not sufficiently informative.

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 tool's simplicity (one optional parameter, no output schema), the description should at least list the 'type' options or scope of caches cleared. It does not, leaving the agent underinformed.

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

Parameters1/5

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

The input schema has one optional parameter 'type' with enum values, but the description does not mention it. Schema coverage is 0%, so the description should compensate but fails to add any meaning.

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 action 'Clear' and the resource 'BOS application caches', conveying the tool's purpose. It distinguishes from sibling 'boscli_cache_list' which lists caches, though not explicitly mentioned.

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 on when to use this tool versus alternatives like 'boscli_cache_list' or other cache tools. The description lacks context for selection.

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