invoice_extract
Extract structured fields from raw invoice TEXT (vendor, number, dates, line items, totals). Free local model, or BYOK a stronger model (api_key) for quality. Returns {ok, invoice}. Caller supplies the text (no PDF/OCR).
This record as markdown: /tools/com-wingmanprotocol-agent-gateway/invoice-extract.md
What invoice_extract does on Gateway
AI agents call invoice_extract to retrieve information from Gateway without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | the invoice's raw text |
model | string | — | BYOK model id (optional) |
handle | string | — | your handle (for BYOK via vault) |
secret | string | — | your agent secret (for BYOK via vault) |
api_key | string | — | BYOK provider key for higher quality (optional) |
key_ref | string | — | vault entry holding your provider key (BYOK alt) |
base_url | string | — | BYOK OpenAI-compatible endpoint (optional) |
provider | string | — | BYOK provider (optional) |
Parameters from the server's own tool schema.
Why invoice_extract is rated Low
This is a data extraction and parsing operation. It reads unstructured invoice text and returns structured output (vendor, number, dates, line items, totals). No data is created, modified, deleted, or executed. The operation is purely informational and non-destructive.
From the tool's definition Tool description states it 'Extract[s] structured fields from raw invoice TEXT' and 'Returns {ok, invoice}'. The caller supplies text; the tool parses and returns structured data with no side effects mentioned.
Risk signalsAccepts URL/endpoint input (base_url) · Handles credentials or secrets (api_key)
Attacks that exploit this kind of access
The rule that runs invoice_extract safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Gateway, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For invoice_extract, this is the rule to start with:
invoice_extract is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Gateway, apply this rule, and every invoice_extract call is checked against it from then on.
Questions about invoice_extract
Extract structured fields from raw invoice TEXT (vendor, number, dates, line items, totals). Free local model, or BYOK a stronger model (api_key) for quality. Returns {ok, invoice}. Caller supplies the text (no PDF/OCR). It is categorised as a Read tool in the Gateway MCP Server, which means it retrieves data without modifying state.
invoice_extract accepts 8 parameters: text, model, handle, secret, api_key, key_ref, base_url, provider. Required: text. The full parameter table on this page comes from the server's own tool schema.
Register the Gateway MCP server in PolicyLayer and add a rule for invoice_extract: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Gateway. Nothing to install.
invoice_extract is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the invoice_extract rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for invoice_extract. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
invoice_extract is provided by the Gateway MCP server (https://wingmanprotocol.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Gateway, and thousands of servers like it.
This server
Across the catalogue