Skip to main content
Glama

Search Invoices Tool

search-invoices
Read-only

Searches authorized invoices using bounded customer, job, status, payment, due-date, and total fields; payment links and addresses are excluded. Use to search invoices in the connected business. Returns query, count, total, invoices, resolution, scope.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search-invoices"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of invoices to return.
queryNoInvoice number, customer name, email, phone, job title, or description.
job_idNoRestrict results to one job ID.
statusNoInvoice lifecycle status.
customer_idNoRestrict results to one customer ID.
payment_statusNoAuthoritative payment state, such as unpaid, pending, paid, or refunded.

Output Schema

NameRequiredDescriptionDefault
countYesCount for the returned result.
queryYesQuery used or returned by this tool.
scopeYesAuthorization scope of this result; data remains restricted to the connected business.
totalYesTotal for the returned result.
invoicesYesBounded invoices records returned by this tool.
resolutionYesResolution metadata; empty collections retain their existing JSON array representation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "count": {
      +      "description": "Count for the returned result.",
      +      "type": "integer"
      +    },
      +    "invoices": {
      +      "description": "Bounded invoices records returned by this tool.",
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "query": {
      +      "description": "Query used or returned by this tool.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "resolution": {
      +      "description": "Resolution metadata; empty collections retain their existing JSON array representation.",
      +      "type": [
      +        "object",
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "scope": {
      +      "description": "Authorization scope of this result; data remains restricted to the connected business.",
      +      "enum": [
      +        "connection_business"
      +      ],
      +      "type": "string"
      +    },
      +    "total": {
      +      "description": "Total for the returned result.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "query",
      +    "count",
      +    "total",
      +    "invoices",
      +    "resolution",
      +    "scope"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavioral context by stating the search is 'bounded' to certain fields and that payment links and addresses are excluded from results, plus 'authorized' implying permission scoping. It does not explain result ordering, pagination, or what happens when the query matches nothing.

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 compact sentences with the field-scope constraint front-loaded and no padding. Minor redundancy between 'Searches authorized invoices...' and 'Use to search invoices in the connected business', which says nearly the same thing twice.

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?

With an output schema present, the trailing 'Returns query, count, total, invoices, resolution, scope' is largely redundant, and the description leaves real gaps: no note that limit caps at 20, no sorting/pagination behavior, and no clarification of what 'authorized' or 'bounded' concretely restricts. Adequate for a moderate-complexity read tool, but not complete.

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 every parameter (limit, query, job_id, status, customer_id, payment_status) is already documented, which sets the baseline at 3. The description's field list loosely maps to those parameters but adds no syntax or matching-behavior detail, and it mentions 'due-date' and 'total' fields that do not exist as parameters, which could mislead slightly.

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 and resource ('Searches authorized invoices') and enumerates the searchable field families (customer, job, status, payment, due-date, total). It does not name or contrast with get-invoice or get-invoice-payment-status, so an agent must infer that this is the list/filter path rather than the single-record path.

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

Usage Guidelines2/5

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

'Use to search invoices in the connected business' restates the purpose rather than giving when-to-use guidance. There is no mention of when to prefer this over get-invoice or get-invoice-payment-status, and no prerequisites or exclusions beyond the field-coverage note.

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