Skip to main content
Glama
bizino

BOS MCP Server

by bizino

bos_smart_order_cycle_time

Analyze order processing time from creation through confirmation, packaging, and delivery to identify bottlenecks and improve efficiency.

Instructions

Phân tích thời gian xử lý đơn hàng (từ lúc tạo đến xác nhận, đóng gói, giao hàng) để tìm ra điểm nghẽn.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYesNgày bắt đầu (YYYY-MM-DD)
end_dateYesNgày kết thúc (YYYY-MM-DD)

Implementation Reference

  • The tool definition for 'bos_smart_order_cycle_time'. The handler calls client.get('/mcp/smart/orders/cycle-time', args) making a GET request to the BOS API endpoint for order cycle time analysis.
    {
      name: 'bos_smart_order_cycle_time',
      description: 'Phân tích thời gian xử lý đơn hàng (từ lúc tạo đến xác nhận, đóng gói, giao hàng) để tìm ra điểm nghẽn.',
      schema: {
        start_date: { type: 'string', description: 'Ngày bắt đầu (YYYY-MM-DD)' },
        end_date: { type: 'string', description: 'Ngày kết thúc (YYYY-MM-DD)' }
      },
      handler: async (args, client) => client.get('/mcp/smart/orders/cycle-time', args),
    },
  • src/index.ts:44-44 (registration)
    Import of smartTools (which includes bos_smart_order_cycle_time) into the main server file.
    ...erpTools,
  • src/index.ts:55-76 (registration)
    Registration loop where all tools (including bos_smart_order_cycle_time) are registered with the MCP server via server.tool() using 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,
            };
          }
        }
      );
    }
  • The McpTool interface that defines the shape of a tool (name, description, schema, handler), used by the bos_smart_order_cycle_time definition.
    export interface McpTool {
      name: string;
      description: string;
      schema: Record<string, any>;
      handler: (args: any, client: BosApiClient) => Promise<any>;
    }
  • The toZodSchema function that converts the simple schema format to Zod schemas 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, the description bears full burden of disclosing behavioral traits. It mentions analyzing time intervals but omits whether the tool returns a report, requires specific permissions, or is read-only. It does not explain what the output represents (e.g., average times, bottleneck locations).

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?

Single sentence in Vietnamese is concise and front-loaded with the core action. Could be slightly more structured (e.g., listing life cycle stages), but no wasted words.

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 no output schema and no annotations, the description should explain what the analysis produces (e.g., report, chart, metrics). It lacks essential context for an agent to interpret results or use the tool effectively in a decision-making workflow.

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?

Input schema covers both parameters (start_date, end_date) with descriptions defining format (YYYY-MM-DD). Description adds no additional meaning beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool's purpose: analyzing order cycle time from creation to delivery to find bottlenecks. The verb 'analyze' and resource 'order cycle time' are specific, and it distinguishes itself from sibling smart tools like bos_smart_orders_summary which focuses on order summaries.

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

Usage Guidelines3/5

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

Description implies that this tool is used when analyzing order processing delays, but lacks explicit guidance on when to use it versus alternatives (e.g., bos_smart_orders_summary for order counts, bos_order_list for raw orders). No when-not conditions mentioned.

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