Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

create_purchase_order

Generate purchase orders for art supply restocking. Automatically includes items below reorder levels and allows custom item additions to maintain optimal inventory.

Instructions

Create a purchase order for restocking. Automatically suggests items below reorder level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoIncludeLowStockNoAutomatically include low stock items from this supplier
customItemsNoOptional: comma-separated SKUs to include
supplierYesSupplier name

Implementation Reference

  • Input schema for the create_purchase_order tool, defining parameters like supplier and auto-include low stock.
    name: 'create_purchase_order',
    description: 'Create a purchase order for restocking. Automatically suggests items below reorder level.',
    inputSchema: {
      type: 'object',
      properties: {
        supplier: { type: 'string', description: 'Supplier name' },
        autoIncludeLowStock: { type: 'boolean', description: 'Automatically include low stock items from this supplier' },
        customItems: { type: 'string', description: 'Optional: comma-separated SKUs to include' },
      },
      required: ['supplier'],
    },
  • Handler logic for create_purchase_order tool that finds supplier, identifies low stock items, calculates order details, and generates a purchase order summary.
    case 'create_purchase_order': {
      const supplier = String(args?.supplier || '');
      const autoInclude = Boolean(args?.autoIncludeLowStock);
      
      const supplierInfo = storeData.suppliers.find(s => s.name.toLowerCase().includes(supplier.toLowerCase()));
      
      if (!supplierInfo) {
        return { content: [{ type: 'text', text: `āŒ Supplier not found: "${supplier}"` }] };
      }
      
      const supplierProducts = storeData.inventory.filter(i => i.supplier === supplierInfo.name);
      const lowStock = autoInclude ? supplierProducts.filter(i => i.quantity <= i.reorderLevel) : [];
      
      const orderTotal = lowStock.reduce((sum, item) => sum + (item.price * (item.reorderLevel * 2 - item.quantity)), 0);
      
      return {
        content: [{
          type: 'text',
          text: `šŸ“ Purchase Order Created\n\nšŸ¢ Supplier: ${supplierInfo.name}\nšŸ“… Date: ${new Date().toISOString().split('T')[0]}\nā±ļø Expected Delivery: ${supplierInfo.leadTime}\n\n${lowStock.length > 0 ? `Items to Order:\n${lowStock.map(item =>
            `• ${item.name} (${item.id})\n  Order Qty: ${item.reorderLevel * 2 - item.quantity} | Est. Cost: $${(item.price * (item.reorderLevel * 2 - item.quantity) * 0.6).toFixed(2)}`
          ).join('\n\n')}\n\nšŸ’° Estimated Total: $${(orderTotal * 0.6).toFixed(2)}` : 'No items below reorder level for this supplier.'}`
        }]
      };
    }
  • src/index.ts:516-518 (registration)
    Registration of the ListToolsRequestSchema handler which returns the list of all tools, including create_purchase_order.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • src/dashboard.ts:54-54 (registration)
    Mock registration of the tool in the dashboard server for UI display purposes.
    { name: 'create_purchase_order', description: 'Generate purchase orders', category: 'Supplier Management' },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool 'Automatically suggests items below reorder level,' which adds some behavioral context, but fails to disclose critical details like required permissions, whether the purchase order is finalized or draft, error handling, or response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that front-loads the core purpose and key feature. There is no wasted verbiage, making it easy to parse and understand quickly.

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 the tool's complexity (a mutation with 3 parameters) and lack of annotations and output schema, the description is minimally adequate. It covers the purpose but lacks details on behavioral traits, error cases, and return values, which are important for a creation tool.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description does not add any meaning beyond what the schema provides, such as explaining interactions between parameters or providing examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the specific action ('Create a purchase order') and resource ('for restocking'), with the added functionality of 'Automatically suggests items below reorder level.' It distinguishes from siblings like 'check_inventory' or 'get_low_stock_items' by focusing on creation rather than retrieval.

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?

The description implies usage for restocking scenarios, but does not explicitly state when to use this tool versus alternatives like 'compare_supplier_prices' or 'get_supplier_info'. No exclusions or prerequisites are mentioned, leaving the context somewhat open-ended.

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/wspotter/mcpart'

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