Skip to main content
Glama

insert_log

Record requests that bypass the gateway by writing request, response, and trace metadata into Portkey; use span fields to stitch trace hierarchies.

Instructions

Insert log records for requests that bypassed the gateway. This writes request, response, and trace metadata into Portkey immediately, and the call will fail if request_provider does not match a configured integration. Use the span fields to stitch trace hierarchies together.

Input Schema

NameRequiredDescriptionDefault
request_urlNoThe endpoint URL being called
request_bodyNoRequest payload/body
metadata_userNoUser identifier for the log
response_bodyNoResponse payload/body
response_timeNoResponse latency in milliseconds
request_methodNoHTTP method used (defaults to 'post')post
streaming_modeNoWhether the response was streamed
metadata_customNoAdditional custom metadata key-value pairs
request_headersNoRequest headers as key-value pairs
response_statusNoHTTP response status code (defaults to 200)
metadata_span_idNoSpan ID for tracing
request_providerNoAI provider name (e.g., 'openai', 'anthropic')
response_headersNoResponse headers as key-value pairs
metadata_trace_idNoTrace ID for distributed tracing
metadata_span_nameNoSpan name for tracing
metadata_organizationNoOrganization identifier for the log
metadata_parent_span_idNoParent span ID for tracing

Output Schema

NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.9
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv1.0.1
  3. Removed
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-readonly, non-idempotent, non-destructive open-world write, so the description doesn't need to restate mutability. It adds real value beyond that: the write lands in Portkey immediately, and there is a validation failure mode tied to request_provider that an agent must satisfy before calling.

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, purpose-first, then write semantics and the failure precondition, then the tracing hint. No filler, though 'writes request, response, and trace metadata into Portkey immediately' lightly restates the resource already named in the first clause.

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 17-parameter write tool with an output schema and fully documented params, the description covers what the schema can't: the intended traffic segment, the external dependency that causes failure, and how to use the span fields. An agent has enough to call it correctly.

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% across 17 parameters, so the baseline is 3, but the description adds semantics the schema cannot convey — that request_provider must resolve to an existing integration, and that the metadata_span_* fields exist to stitch trace hierarchies. That is genuine meaning beyond the field-by-field descriptions.

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 and resource — 'Insert log records' — and immediately narrows the scope to 'requests that bypassed the gateway', which is what separates it from the read-side siblings like get_log and the export tools. An agent can tell what this tool is for without opening 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?

The description gives a clear triggering condition (only for traffic that bypassed the gateway) and a hard precondition: the call fails when request_provider doesn't match a configured integration. It stops short of naming the alternative path (letting the gateway log automatically) or saying when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools