Skip to main content
Glama

Add expense

add_expense
Idempotent

Record an expense paid by one member and split among members. amount is in the group currency ("12.50" or 12.5). split defaults to equal among all active members; method exact takes amounts that sum to the total, method shares takes proportional integers (percentages are shares summing to 100). paid_by defaults to the caller. dry_run returns the computed split without saving. Everyone in the split must already be a member of group_id. Splitting with a contact outside any shared group takes create_group, then create_invite with target_handle; they accept before the expense can be added, so it stays pending for the person until then.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNo
splitNo
amountYes
dry_runNo
paid_byNo
currencyNo
group_idYes
descriptionYes
occurred_atNo
receipt_urlNo
idempotency_keyYesAny unique string you make up for this action, 8-128 characters (a UUID works). Reuse the same key only to retry this exact call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
inboxNo
dry_runYes
expenseYes
suggested_nextYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / paid_by / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "agent_id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "agent_id"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "handle": {
      -        "pattern": "^[a-z0-9][a-z0-9_-]{2,31}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "handle"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "agent_id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "agent_id"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "handle": {
      +        "pattern": "^@?[A-Za-z0-9][A-Za-z0-9_-]{2,31}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "handle"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / split / oneOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "method": {
      -        "const": "equal",
      -        "type": "string"
      -      },
      -      "participants": {
      -        "items": {
      -          "anyOf": [
      -            {
      -              "properties": {
      -                "agent_id": {
      -                  "format": "uuid",
      -                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "agent_id"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "properties": {
      -                "handle": {
      -                  "pattern": "^[a-z0-9][a-z0-9_-]{2,31}$",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "handle"
      -              ],
      -              "type": "object"
      -            }
      -          ]
      -        },
      -        "maxItems": 50,
      -        "minItems": 1,
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "method"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "method": {
      -        "const": "exact",
      -        "type": "string"
      -      },
      -      "shares": {
      -        "items": {
      -          "properties": {
      -            "agent": {
      -              "anyOf": [
      -                {
      -                  "properties": {
      -                    "agent_id": {
      -                      "format": "uuid",
      -                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "agent_id"
      -                  ],
      -                  "type": "object"
      -                },
      -                {
      -                  "properties": {
      -                    "handle": {
      -                      "pattern": "^[a-z0-9][a-z0-9_-]{2,31}$",
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "handle"
      -                  ],
      -                  "type": "object"
      -                }
      -              ]
      -            },
      -            "amount": {
      -              "anyOf": [
      -                {
      -                  "maxLength": 32,
      -                  "minLength": 1,
      -                  "type": "string"
      -                },
      -                {
      -                  "exclusiveMinimum": 0,
      -                  "type": "number"
      -                }
      -              ]
      -            }
      -          },
      -          "required": [
      -            "agent",
      -            "amount"
      -          ],
      -          "type": "object"
      -        },
      -        "maxItems": 50,
      -        "minItems": 1,
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "method",
      -      "shares"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "method": {
      -        "const": "shares",
      -        "type": "string"
      -      },
      -      "shares": {
      -        "items": {
      -          "properties": {
      -            "agent": {
      -              "anyOf": [
      -                {
      -                  "properties": {
      -                    "agent_id": {
      -                      "format": "uuid",
      -                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "agent_id"
      -                  ],
      -                  "type": "object"
      -                },
      -                {
      -                  "properties": {
      -                    "handle": {
      -                      "pattern": "^[a-z0-9][a-z0-9_-]{2,31}$",
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "handle"
      -                  ],
      -                  "type": "object"
      -                }
      -              ]
      -            },
      -            "shares": {
      -              "maximum": 1000000,
      -              "minimum": 1,
      -              "type": "integer"
      -            }
      -          },
      -          "required": [
      -            "agent",
      -            "shares"
      -          ],
      -          "type": "object"
      -        },
      -        "maxItems": 50,
      -        "minItems": 1,
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "method",
      -      "shares"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "method": {
      +        "const": "equal",
      +        "type": "string"
      +      },
      +      "participants": {
      +        "items": {
      +          "anyOf": [
      +            {
      +              "properties": {
      +                "agent_id": {
      +                  "format": "uuid",
      +                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "agent_id"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "properties": {
      +                "handle": {
      +                  "pattern": "^@?[A-Za-z0-9][A-Za-z0-9_-]{2,31}$",
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "handle"
      +              ],
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "maxItems": 50,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "method"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "method": {
      +        "const": "exact",
      +        "type": "string"
      +      },
      +      "shares": {
      +        "items": {
      +          "properties": {
      +            "agent": {
      +              "anyOf": [
      +                {
      +                  "properties": {
      +                    "agent_id": {
      +                      "format": "uuid",
      +                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "agent_id"
      +                  ],
      +                  "type": "object"
      +                },
      +                {
      +                  "properties": {
      +                    "handle": {
      +                      "pattern": "^@?[A-Za-z0-9][A-Za-z0-9_-]{2,31}$",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "handle"
      +                  ],
      +                  "type": "object"
      +                }
      +              ]
      +            },
      +            "amount": {
      +              "anyOf": [
      +                {
      +                  "maxLength": 32,
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                {
      +                  "exclusiveMinimum": 0,
      +                  "type": "number"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [
      +            "agent",
      +            "amount"
      +          ],
      +          "type": "object"
      +        },
      +        "maxItems": 50,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "method",
      +      "shares"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "method": {
      +        "const": "shares",
      +        "type": "string"
      +      },
      +      "shares": {
      +        "items": {
      +          "properties": {
      +            "agent": {
      +              "anyOf": [
      +                {
      +                  "properties": {
      +                    "agent_id": {
      +                      "format": "uuid",
      +                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "agent_id"
      +                  ],
      +                  "type": "object"
      +                },
      +                {
      +                  "properties": {
      +                    "handle": {
      +                      "pattern": "^@?[A-Za-z0-9][A-Za-z0-9_-]{2,31}$",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "handle"
      +                  ],
      +                  "type": "object"
      +                }
      +              ]
      +            },
      +            "shares": {
      +              "maximum": 1000000,
      +              "minimum": 1,
      +              "type": "integer"
      +            }
      +          },
      +          "required": [
      +            "agent",
      +            "shares"
      +          ],
      +          "type": "object"
      +        },
      +        "maxItems": 50,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "method",
      +      "shares"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (readOnlyHint=false, idempotentHint=true, destructiveHint=false) and the description adds substantial behavioral detail: dry_run returns computed split without saving, split methods and defaults, membership constraint, and pending state for contacts outside shared groups. This goes well beyond structured data.

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, front-loaded paragraph that efficiently conveys the purpose, key defaults, and important edge cases. Every sentence adds value, and it is appropriately sized for a tool with 11 parameters and complex split logic.

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?

Given the complexity (11 params, nested split, output schema present), the description covers the core behavior and constraints well. Minor gaps remain for optional parameters like currency and occurred_at, but the tool is usable for its primary purpose without additional documentation.

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?

With only 9% schema description coverage, the description compensates for the most complex parameters: amount format, split methods (equal, exact, shares), paid_by default, and dry_run. It does not explain optional params like currency, occurred_at, or receipt_url, but covers the critical split logic thoroughly.

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?

States a specific verb (record) and resource (expense), and distinguishes itself from record_payment by describing the split among members. The description makes clear what the tool does and when to use it, without needing the schema.

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?

Provides clear context and prerequisites (membership requirement, flow for outside contacts via create_group and create_invite) but does not explicitly compare to sibling tools like update_expense or delete_expense. It gives sufficient guidance for a user to know when to call this tool.

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.