Skip to main content
Glama

create_webhook

Register a URL to receive this company's document events.

Every document authorized, rejected, cancelled or corrected, and every received NF-e first stored (received_invoice.stored) or whose full XML arrived (received_invoice.full_document), is then sent there, signed with the secret. Confirm the URL with the user before calling: it is where their fiscal data goes. The API refuses a URL that is not HTTPS or points at a private network. Needs webhook:manage.

Calling it twice registers two endpoints, and each receives every event: list_webhooks first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>",
      "secret": "<secret>"
    },
    "name": "create_webhook"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesWhere to deliver, an https:// URL the user gave. Never one you made up.
eventsNoWhich events to send. Every one if omitted.
secretYes16 to 255 characters the user chose; every delivery is signed with it. It is never shown again, so do not repeat it back.
company_idNoUUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both.
company_tax_idNoCNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both.

Output Schema

NameRequiredDescriptionDefault
idNoPass it to delete_webhook.
urlNo
eventsNoThe events sent there. Empty means every event.
is_activeNo
created_atNo
environmentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
  2. Changed3 schema fields changed
    • changedInput schema / properties / company_id / description
      Previous value: -"UUID of the company this call acts for. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"UUID of the company acted for. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / company_tax_id / description
      Previous value: -"CNPJ or CPF of the company this call acts for, never the recipient or a taxpayer being looked up. Omit it when the connection covers a single company; with several it is required (see list_authorized_companies). Send company_id or company_tax_id, never both."New value: +"CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit it if the connection covers a single company; else see list_authorized_companies. company_id or company_tax_id, never both."
    • changedInput schema / properties / events / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "enum": [
      -        "invoice.authorized",
      -        "invoice.rejected",
      -        "invoice.cancelled",
      -        "invoice.corrected"
      -      ],
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "enum": [
      +        "invoice.authorized",
      +        "invoice.rejected",
      +        "invoice.cancelled",
      +        "invoice.corrected",
      +        "received_invoice.stored",
      +        "received_invoice.full_document"
      +      ],
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Added

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations it discloses the signing behavior, the required scope (webhook:manage), the server-side validation (rejects non-HTTPS or private-network URLs) and the secret's irreversibility. That it registers a second endpoint on a repeat call is consistent with idempotentHint=false but adds useful concrete detail; only a description of what a successful response contains is absent, and the output schema covers that.

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?

Front-loaded with the action, then constraints, then the duplicate-registration warning; every sentence carries information. The line breaks are ragged and the event enumeration partly duplicates the schema's enum, so it is not maximally tight.

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

Completeness5/5

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

For a mutating, non-idempotent, open-world-flagged registration tool, the description covers what it creates, what gets delivered, required scope, validation failures and the duplicate-call hazard. An output schema exists, so return values need not be described.

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 coverage is 100%, so the baseline is 3; the description still adds meaning by explaining what the enumerated events correspond to (authorization, rejection, cancellation, correction, NF-e storage) and by reinforcing that deliveries are signed with the secret. It does not expand on company_id versus company_tax_id exclusivity, which the schema already handles.

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?

The first sentence gives a specific verb and resource ('Register a URL to receive this company's document events') and the body enumerates exactly which events flow to that URL. An agent can tell this apart from list_webhooks and delete_webhook without opening any schema.

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

Usage Guidelines5/5

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

It states preconditions ('Confirm the URL with the user before calling: it is where their fiscal data goes'), the correct prior step ('list_webhooks first') and the consequence of skipping it (duplicate endpoints each receiving every event).

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.