# StepContext.set_output
URL: https://lsd.tools/docs/api-context-set-output
Updated: 2026-07-17

## Parameters

| name | type | default | description |
|---|---|---|---|
| `name` | `str` | — | the `graph_outputs` param name to set |
| `value` | `Any` | — | the scalar value to record on the node card |

## Example

```python
@tool.shape(graph_outputs=["n_rows"])
def keep_top(t: Table, ctx: StepContext) -> Table:
    out = t.filter(t["score"] > 10)
    ctx.set_output("n_rows", len(out))
    return out
```

## Notes

The name must be a param declared via `@tool.<kind>(graph_outputs=…)`. These are `output=True`
params — **excluded from the cache key** and emitted in `STEP_FINISHED` — so setting them never
affects resume caching.

## See also

**API:** [progress](/docs/api-context-progress) · [emit](/docs/api-context-emit) · [StepContext](/docs/api-context)

**Guides:** [Parameters vs ports](/docs/tools-params-ports)
