Skip to main content
Glama
bizino

BOS MCP Server

by bizino

bos_inventory_update

Adjust product inventory by setting, adding, or subtracting stock quantities. Record a reason for each inventory change to maintain accurate records.

Instructions

Update inventory stock

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYes
quantityYes
typeYes
reasonNo

Implementation Reference

  • The handler function for bos_inventory_update that sends a POST request to /mcp/inventory/update with the args (product_id, quantity, type, reason).
    handler: async (args, client) => client.post('/mcp/inventory/update', args),
  • Input schema for bos_inventory_update: requires product_id (string), quantity (number), type (one of 'set', 'add', 'subtract'), and optional reason (string).
    schema: {
      product_id: { type: 'string' },
      quantity: { type: 'number' },
      type: { type: 'string', enum: ['set', 'add', 'subtract'] },
      reason: { type: 'string', optional: true },
    },
  • The tool 'bos_inventory_update' is defined as part of the inventoryTools array in src/tools/bos.ts (lines 414-424). It is then exported and registered into the MCP server in src/index.ts, src/http.ts, and src/stdio.ts.
    export const inventoryTools: McpTool[] = [
      {
        name: 'bos_inventory_list',
        description: 'List inventory stock across all products',
        schema: {
          page: { type: 'number', optional: true },
          page_size: { type: 'number', optional: true },
          warehouse_id: { type: 'string', optional: true },
        },
        handler: async (args, client) => client.get('/mcp/inventory', args),
      },
      {
        name: 'bos_inventory_check',
        description: 'Check stock quantity for a product',
        schema: { product_id: { type: 'string' } },
        handler: async (args, client) => client.get(`/mcp/inventory/check/${args.product_id}`),
      },
      {
        name: 'bos_inventory_update',
        description: 'Update inventory stock',
        schema: {
          product_id: { type: 'string' },
          quantity: { type: 'number' },
          type: { type: 'string', enum: ['set', 'add', 'subtract'] },
          reason: { type: 'string', optional: true },
        },
        handler: async (args, client) => client.post('/mcp/inventory/update', args),
      },
      {
        name: 'bos_inventory_low_stock',
        description: 'Get products with low stock alerts',
        schema: { threshold: { type: 'number', optional: true } },
        handler: async (args, client) => client.get('/mcp/inventory/low-stock', args),
      },
    ];
  • src/index.ts:55-76 (registration)
    Registration loop in src/index.ts that registers all tools (including bos_inventory_update) with the MCP server via 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 toZodSchema helper converts the simple schema definition (e.g., type: 'string', enum: [...], optional: true) into a Zod schema used for validation at 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, the description bears full responsibility for behavioral disclosure. It only states 'Update inventory stock' without explaining the types of updates (set, add, subtract), side effects, or required permissions. The agent learns little beyond the name.

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 and front-loaded, which aids quick scanning. However, it is under-specified for a tool with 4 parameters and no output schema, sacrificing completeness for brevity.

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 output schema, annotations, and parameter descriptions, the description is incomplete. It does not explain return values, success/failure indicators, or side effects, leaving significant gaps for a mutation tool.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must add meaning. It does not describe any parameter. The agent must infer from parameter names and the enum, but the description adds no additional context about how 'type' works or what 'reason' is for.

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 'Update inventory stock' clearly identifies the action (update) and resource (inventory stock). It distinguishes itself from read-oriented siblings like bos_inventory_list or bos_inventory_check, though it does not explicitly differentiate from bos_product_stock or bos_product_update.

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 (e.g., bos_product_update for other product changes, or bos_stock_movement_list for viewing changes). There is no mention of prerequisites, context, or when not to use it.

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