Skip to main content

Custom Step Tracking

Use Observe.observe() for orchestration steps, tool execution, policy checks, and handoffs that provider SDKs do not expose.

Overview

Custom agent steps are the fallback integration path for frameworks, internal tools, and orchestration code without a dedicated adapter. Wrap the function you control and add Beacon compatibility attributes that describe what happened.

What Asymptote Captures

  • A span for each wrapped function call.
  • Input count and output type unless disabled.
  • Errors recorded on failed spans.
  • Beacon compatibility attributes such as beacon.event.action, beacon.tool.name, beacon.mcp.server, and beacon.approval.decision.

Prerequisites

  • Node.js 20 or newer.
  • @asymptote/sdk installed.
  • The agent framework, tool client, or internal orchestration code you want to wrap.
  • ASYMPTOTE_API_KEY set for Asymptote Managed hosted Observe, or OTEL_EXPORTER_OTLP_ENDPOINT set for customer-managed OTLP export. To get an Asymptote Managed API key, reach out for a demo.
Install the SDK
Set an export destination:
Set the Asymptote Managed API key

Getting Started

Wrap a custom tool step
The wrapped function preserves the original return behavior for sync functions, promises, and async iterables. Errors are recorded on the span and then rethrown.

Avoid Sensitive Metadata

Set ignoreInput or ignoreOutput when wrapper metadata should avoid recording argument counts or output type.
Redact sensitive step metadata

Common Beacon Actions

Use Beacon compatibility attributes when a custom step should normalize into a known event category.
Wrap an MCP tool call
See the SDK reference for the full attribute list.

Troubleshooting

  • Confirm Observe.initialize() runs before wrapped functions are called.
  • Confirm the wrapped function returned by Observe.observe() is the function your application invokes.
  • Use ignoreInput or ignoreOutput for sensitive steps.
  • Call Observe.flush() before short-lived scripts or jobs exit.

What’s Next

Observe

Review the full manual span wrapper reference.

SDK Reference

Review supported Beacon compatibility attributes.