Skip to main content
Glama

Last Price

update_function

DestructiveIdempotent

Change a pricing function your workspace owns: its display name, description, status, tags, cost per unit, cost multiplier, endpoint, credential, schemas or model configuration. Only the fields you send change. Built-in functions and other workspaces' functions cannot be changed. Needs a Last Price credential with function publish scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.

Input Schema

NameRequiredDescriptionDefault
ruleNoFor a rule based function: the rule it prices by. Its input schema is made from the rule, and a rule based function needs one before it can be active. On update null removes it.
tagsNoThe tag list. On update it replaces the whole list.
statusNoactive functions are routed to; draft, review, inactive and deprecated ones are not.
auth_configNoHow to authenticate to the endpoint, such as { type: "bearer", token: "..." }. Stored encrypted and never returned: a read says only whether one is saved. On update an object replaces it and null removes it. Treat the secret as sensitive: it passes through this conversation.
descriptionNoWhat the function does. Null clears it.
function_idYesThe pricing function UUID: id on a list_functions result.
display_nameNoThe name people and agents see.
endpoint_urlNoFor a function that calls your own service: the https endpoint that returns the price.
input_schemaNoJSON Schema of what a price request supplies to the function.
cost_per_unitNoWhat one call to the function costs, in USD.
output_schemaNoJSON Schema of what the function returns.
cost_multiplierNoMultiplies the cost of each call, for a more expensive model tier. 1 is the default; stored to 4 decimal places.
inference_configNoFor a function that runs on a model. On update an object replaces it and null removes it, so the function uses the rule-based formula.
quote_valid_secondsNoHow long a price this function computes stays valid, in seconds (30 to 86400). Prices carry it as valid_until where quote expiry is switched on for the workspace. Omit for the default of 15 minutes; on update null returns to the default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / rule
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "For a rule based function: the rule it prices by. Its input schema is made from the rule, and a rule based function needs one before it can be active. On update null removes it.",
      +  "properties": {
      +    "base": {
      +      "additionalProperties": {},
      +      "description": "Where the price starts: {\"from\":\"current_price\"}, {\"from\":\"unit_cost\"}, {\"from\":\"competitor_prices\",\"pick\":\"min\"|\"avg\"|\"max\"} or {\"from\":\"field\",\"field\":\"<context field>\"}.",
      +      "type": "object"
      +    },
      +    "steps": {
      +      "description": "Applied in order: adjust_pct, margin (target_margin_pct), scale, tiers, floor, ceiling, ending (cents such as 0.99) and round. A floor or ceiling holds through every later step.",
      +      "items": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "base"
      +  ],
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  2. Changed7 schema fields changed
    • addedInput schema / properties / auth_config
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "How to authenticate to the endpoint, such as { type: \"bearer\", token: \"...\" }. Stored encrypted and never returned: a read says only whether one is saved. On update an object replaces it and null removes it. Treat the secret as sensitive: it passes through this conversation.",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / endpoint_url
      Added value: +{
      +  "description": "For a function that calls your own service: the https endpoint that returns the price.",
      +  "format": "uri",
      +  "type": "string"
      +}
    • addedInput schema / properties / inference_config
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "For a function that runs on a model. On update an object replaces it and null removes it, so the function uses the rule-based formula.",
      +  "properties": {
      +    "model": {
      +      "description": "The model id at that provider.",
      +      "maxLength": 200,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "prompt": {
      +      "description": "Your pricing instructions for the model.",
      +      "maxLength": 4000,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "provider": {
      +      "description": "The model provider.",
      +      "enum": [
      +        "openai",
      +        "anthropic",
      +        "openrouter",
      +        "together-ai",
      +        "huggingface",
      +        "replicate",
      +        "baseten",
      +        "aitune"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "provider"
      +  ],
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / input_schema
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "JSON Schema of what a price request supplies to the function.",
      +  "type": "object"
      +}
    • addedInput schema / properties / output_schema
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "JSON Schema of what the function returns.",
      +  "type": "object"
      +}
    • addedInput schema / properties / quote_valid_seconds
      Added value: +{
      +  "description": "How long a price this function computes stays valid, in seconds (30 to 86400). Prices carry it as valid_until where quote expiry is switched on for the workspace. Omit for the default of 15 minutes; on update null returns to the default.",
      +  "maximum": 86400,
      +  "minimum": 30,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / tags / description
      Previous value: -"Replaces the whole tag list."New value: +"The tag list. On update it replaces the whole list."
  3. Added

TDQS

A4.3/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing the preconditions an agent would otherwise hit blind: a Last Price credential with function publish scope and a claimed (non-sandbox) workspace, with the concrete 403 failure mode. It does not explain why destructiveHint is true (list replacement, null-clears on auth_config/rule/inference_config are only in the schema), leaving that annotation somewhat unexplained.

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?

Three sentences, action and mutable-field list front-loaded, then constraints, then auth preconditions. Dense but every clause carries operational weight; the closing sandbox-key parenthetical is slightly tangential but prevents a real failure.

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 14-parameter mutation tool with nested objects and no output schema, the description covers ownership, update semantics, permissions, and the main failure mode. Return behavior is unaddressed, and the destructive side of the operation (whole-list tag replacement, null-clearing of auth_config/rule/inference_config) is left entirely to the schema.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds a curated field inventory that maps directly onto the 14 parameters and states the partial-update contract that the schema cannot express per-field. It does not touch the nested rule/inference_config internals, which the schema handles well.

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?

Opens with a specific verb and resource ("Change a pricing function your workspace owns") and enumerates exactly which attributes are mutable, so it cannot be confused with create_function, delete_function, or get_function. The ownership qualifier further narrows scope.

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

Usage Guidelines4/5

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

"Only the fields you send change" explicitly establishes partial-update semantics, and the exclusions (built-in functions, other workspaces' functions, unclaimed sandbox workspaces returning 403) tell the agent when the call will be refused. It never names a sibling alternative such as create_function or get_function, which keeps it short of a 5.

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