Skip to main content
Glama

insert_log

Insert log records for requests that bypassed the gateway, storing request, response, and trace metadata in 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

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

Output Schema

TableJSON 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
Behavior4/5

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

Annotations already indicate write operation (readOnlyHint=false) and openWorldHint=true. The description adds that writes happen immediately and that the tool fails if provider is unconfigured. It also explains span field usage.

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?

Three sentences, front-loaded with purpose, each sentence adds unique and necessary information. No wasted words.

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?

The description covers the core purpose and key constraints, but given the tool's complexity (17 parameters, open-world hint), it lacks details on return values, error handling beyond the provider mismatch, and potential side effects.

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 covers 100% of parameter descriptions, but the description adds value by explaining that span fields are for stitching trace hierarchies and that request_provider must match a configured integration.

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 description uses a specific verb ('insert') and resource ('log records for requests that bypassed the gateway'), clearly distinguishing from sibling tools. It also notes immediacy and the type of metadata written.

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

Usage Guidelines3/5

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

The description gives a specific use case (bypassed gateway requests) and a critical constraint (failure if request_provider mismatched), but does not explicitly state when not to use this tool or suggest alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server