> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sedata-ai.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic attributes

> Every span attribute the package writes — what it means, when it appears.

Every span produced by the auto-instrumentation includes a set of attributes
out of the box. Some are unconditional, others appear under specific
configurations.

## Always present

| Attribute                | Type    | Description                                                               |
| ------------------------ | ------- | ------------------------------------------------------------------------- |
| `mcp.method.name`        | string  | Always `"tools/call"` for tool invocations.                               |
| `mcp.tool.name`          | string  | The tool name passed to `registerTool`.                                   |
| `mcp.tool.title`         | string  | Tool title from the tool config (may be undefined if not set).            |
| `mcp.tool.description`   | string  | Tool description from the tool config.                                    |
| `mcp.request.id`         | string  | UUID generated per request. Unique per call.                              |
| `mcp.session.id`         | string  | UUID generated when the SDK starts. Constant for the process.             |
| `mcp.operation.success`  | boolean | `true` on OK, `false` on thrown error.                                    |
| `mcp.operation.duration` | number  | Duration in ms.                                                           |
| `client.address`         | string  | First non-internal IPv4 address of the host. Falls back to `"localhost"`. |

## Conditional

### When `enableArgumentCollection: true`

Each tool argument is flattened into a `mcp.request.argument.<key>` attribute.
Nested objects use dot notation.

```text theme={null}
mcp.request.argument.weightKg = 70
mcp.request.argument.heightM = 1.75
mcp.request.argument.metadata.locale = 'en-US'
```

<Warning>
  Off by default — these often contain user input or PII.
</Warning>

### When the handler is wrapped with `safetyCheck`

| Attribute                     | Type    | Description                                                    |
| ----------------------------- | ------- | -------------------------------------------------------------- |
| `mcp.safety_check.content`    | string  | Original content passed to the safety API.                     |
| `mcp.safety_check.flagged`    | boolean | `true` if Sedata's API flagged the input.                      |
| `mcp.safety_check.latency_ms` | number  | Round-trip latency of the safety check.                        |
| `mcp.safety_check.success`    | boolean | `true` if the safety API responded OK (regardless of verdict). |

### When `process.env.PORT` is set

| Attribute     | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| `client.port` | string | Value of `process.env.PORT`. |

### On error

| Attribute       | Type   | Description                            |
| --------------- | ------ | -------------------------------------- |
| `error.type`    | string | Error class name (e.g. `"TypeError"`). |
| `error.message` | string | Error message.                         |

## Resource attributes

Attached once per process and merged into every export:

| Attribute                      | Source                               |
| ------------------------------ | ------------------------------------ |
| `service.name`                 | `config.serverName`                  |
| `service.version`              | `config.serverVersion`               |
| `mcp.session.id`               | UUID per process                     |
| Host / OS / env detector attrs | `@opentelemetry/resources` detectors |

## Filtering reference for dashboards

Common filter patterns:

```text theme={null}
service.name = "weather-mcp"
mcp.tool.name = "calculate-bmi"
mcp.operation.success = false
mcp.safety_check.flagged = true
```

## See also

<CardGroup cols={2}>
  <Card title="Tracing concept" icon="route" href="/concepts/tracing">
    How attributes get attached to spans.
  </Card>

  <Card title="Data processors" icon="filter" href="/guides/data-processors">
    Mutate or remove attributes before export.
  </Card>
</CardGroup>
