Skip to main content
Glama

insert_log

Insert log records for requests that bypassed the gateway. Writes request, response, and trace metadata into Portkey immediately.

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
Behavior5/5

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

Annotations (readOnlyHint=false, destructiveHint=false) indicate a write operation. The description adds that writes are immediate, fail on unmatching provider, and span fields enable trace hierarchy. All behaviors are disclosed without contradiction.

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?

The description is two sentences front-loaded with purpose and context. Every sentence provides meaningful information without redundancy or fluff.

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

Completeness4/5

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

Given the tool complexity (17 parameters) and existing schema/annotations/output schema, the description covers purpose, usage condition, failure case, and tracing guidance. It could optionally mention what the function returns, but output schema likely handles that, so it is nearly complete.

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?

All 17 parameters have descriptions in the schema (100% coverage), so baseline is 3. The description adds value by explaining span fields 'stitch trace hierarchies together' and the failure condition for request_provider, which goes beyond the schema's generic 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?

The description clearly states 'Insert log records for requests that bypassed the gateway' – a specific verb and resource with context. It distinguishes from sibling tools by focusing on bypassed requests, which is unique among the many create and log tools.

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 specifies when to use (bypassed gateway requests), includes a failure condition ('call will fail if request_provider does not match a configured integration'), and provides guidance on trace stitching. However, it does not explicitly state when not to use or compare to alternative logging methods.

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