Skip to main content
Glama

Create purchase order line

create_purchase_order_line

Add a line item to a purchase order. Requires purchase_orders:write scope. The PO's amount becomes the sum of its lines. A line naming a part_id is counted in whole units, and its quantity_received is added to that part's stock. Required: purchase_order_id, description, quantity.

Input Schema

NameRequiredDescriptionDefault
part_idNoPart from inventory - resolve via list_parts
quantityYesQuantity ordered (required)
unit_costNoPrice per unit, in the organization currency
descriptionYesWhat is being ordered (required)
line_numberNoPosition on the order. Omit it to add the line after the last one.
purchase_order_idYesPurchase order ID (required) - resolve via list_purchase_orders
quantity_receivedNoQuantity received so far, 0 to quantity

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / line_number / description
      Previous value: -"Position on the order"New value: +"Position on the order. Omit it to add the line after the last one."
  2. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / line_number / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / part_id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
    • addedInput schema / properties / purchase_order_id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
  3. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"https://json-schema.org/draft/2020-12/schema"New value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / line_number / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / part_id / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
    • removedInput schema / properties / purchase_order_id / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
  4. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / line_number / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / part_id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
    • addedInput schema / properties / purchase_order_id / pattern
      Added value: +"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
  5. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already state this is a non-read-only, non-idempotent, non-destructive write. The description goes beyond them by disclosing real side effects: the PO amount recomputes as the sum of lines, part_id lines are counted in whole units, and quantity_received is added to the referenced part's stock. That upstream inventory mutation is exactly the kind of behavior an agent needs. It does not mention rollback/permissions beyond scope, so not a 5.

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?

Four short sentences, front-loaded with the action, then scope, then side effects, then required fields. The trailing required-fields sentence duplicates the schema's required array, which is mild waste, but nothing else is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter mutation with no output schema, the description covers action, permission prerequisite, parent-aggregate effect, and stock side effect. It omits return shape and error/validation behavior, but the core decision-relevant context is present.

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 all seven parameters are already documented, including the list_parts/list_purchase_orders resolution hints and line_number omission behavior. The description restates the three required fields and adds the part_id/quantity_received interaction, but adds little beyond the schema. Baseline 3 per the high-coverage rule.

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?

States a specific verb+resource: adding a line item to a purchase order. That is clearly distinct from create_purchase_order (the parent) and update_purchase_order_line. It does not explicitly name those siblings, so it lands just short of 5.

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?

Gives a real prerequisite (purchase_orders:write scope), which is genuine usage guidance. However it never says when to prefer this over bulk_create or update_purchase_order_line, and gives no conditions for exclusion. Adequate but with clear gaps.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources