diff --git a/src/_data/sidebars/help.yml b/src/_data/sidebars/help.yml index 425751ae..a6a388ec 100644 --- a/src/_data/sidebars/help.yml +++ b/src/_data/sidebars/help.yml @@ -169,13 +169,15 @@ resources: link: /mcp-servers/runtime-expressions/ - label: Debug sessions link: /mcp-servers/debug-sessions/ + - label: Logs + link: /mcp-servers/logs/ - label: Security link: /mcp-servers/security/ - type: category - label: Customization options - items: - - label: Custom domains - link: /mcp-servers/customization-options/custom-domain/ + label: Customization options + items: + - label: Custom domains + link: /mcp-servers/customization-options/custom-domain/ - label: Specification support items: - label: Flower support diff --git a/src/_help/mcp-servers/index.md b/src/_help/mcp-servers/index.md index ae72618a..af2b094e 100644 --- a/src/_help/mcp-servers/index.md +++ b/src/_help/mcp-servers/index.md @@ -42,4 +42,5 @@ Both formats support multi-step sequences, conditional logic (retry, goto, end), - [Access management](/help/mcp-servers/access-management/): control who can use your MCP server. - [Debug sessions](/help/mcp-servers/debug-sessions/): inspect execution traces to troubleshoot workflows step by step. - [Runtime expressions](/help/mcp-servers/runtime-expressions/): reference dynamic data between steps. +- [Logs](/help/mcp-servers/logs/): monitor every tool call made to your MCP server. - [Security](/help/mcp-servers/security/): understand the architecture and data handling guarantees. \ No newline at end of file diff --git a/src/_help/mcp-servers/logs.md b/src/_help/mcp-servers/logs.md new file mode 100644 index 00000000..c16d0c05 --- /dev/null +++ b/src/_help/mcp-servers/logs.md @@ -0,0 +1,50 @@ +--- +title: Logs +--- + +- TOC +{:toc} + +Logs list every tool call made to your MCP server: which tool was invoked, when, by what source, whether it succeeded, and how long it took. Unlike [debug sessions](/help/mcp-servers/debug-sessions/), which capture a live trace for a limited window, logs keep a persistent history of your server's activity so you can monitor usage and investigate issues after the fact. + +Logs can be found in your MCP server settings. + +![MCP server logs page](/docs/images/help/mcp-servers/mcp-servers-logs.png) + +## Read the logs table + +Each row is one tool call, with the following columns: + +- **Tool**: the name of the tool invoked, matching a flow `id` in your workflow document. +- **Date**: when the tool was called. +- **State**: `Success` or `Error`. Error details can be found by clicking on a row. +- **Duration**: execution time of the tool. +- **Source**: where the call came from. + - `MCP`: the tool was called through the MCP server by an AI tool connected over the MCP protocol (Claude, Cursor, ChatGPT, etc.). + - `Agent`: the tool was called through the agent endpoint. +- **Custom analytics**: any data you chose to surface for that tool by defining `analytics` in your workflow document. See [Custom analytics](#custom-analytics) below. + +You can click on a specific log to get more information about its run. + +## Custom analytics + +By default, logs tell you that a tool ran and whether it succeeded, but not what it actually did. Custom analytics let you surface any part of a tool's execution, so you can inspect the values that mattered for a given tool call, without opening a debug session. + +Define them with the `analytics` property on a `flow`, using [runtime expressions](/help/mcp-servers/runtime-expressions/) to reference inputs, step outputs, config values, or anything else available during execution: + +```yaml +flows: + - id: book_trip_confirmation + # ... + analytics: + booking.id: $steps.create_booking.outputs.id + booking.details: $steps.create_booking.outputs.details +``` + +Each key becomes a value in the `Custom analytics` column for that tool's log entries. + +> Only authentication data (`$secrets`, `$current_user.token`) are always excluded from analytics. Everything else you reference is logged as-is, so avoid surfacing values that may contain personal data or other sensitive content. +{: .warning} + +> See the [Flower specification](/help/mcp-servers/specification-support/flower-support/#custom-analytics) for the full `analytics` reference. +{: .info} diff --git a/src/_help/mcp-servers/specification-support/flower-support.md b/src/_help/mcp-servers/specification-support/flower-support.md index 6fcedeb3..d25c3b04 100644 --- a/src/_help/mcp-servers/specification-support/flower-support.md +++ b/src/_help/mcp-servers/specification-support/flower-support.md @@ -92,6 +92,7 @@ A flow accepts inputs, executes a series of steps, and produces outputs. | `inputs` | No | Input parameters, defined using [JSON Schema](https://json-schema.org/) format. | | `steps` | Yes | Array of step definitions, executed sequentially. | | `outputs` | No | Values extracted from step results using [runtime expressions](#runtime-expressions). | +| `analytics` | No | Custom key-value data surfaced in your MCP server's [logs](/help/mcp-servers/logs/), using [runtime expressions](#runtime-expressions). | ### Inputs @@ -123,6 +124,24 @@ outputs: city_name: $steps.get-coords.outputs.city ``` +### Custom analytics + +Attach custom key-value data to each execution of a tool. It is surfaced in your MCP server's [logs](/help/mcp-servers/logs/), letting you inspect what a tool call actually did without opening a debug session. + +Each value is defined using a [runtime expression](#runtime-expressions) and can reference inputs, step outputs, config values, or anything else available during execution: + +```yaml +flows: + - id: book_trip_confirmation + # ... + analytics: + booking.id: $steps.create_booking.outputs.id + booking.details: $steps.create_booking.outputs.details +``` + +> Only authentication data (`$secrets`, `$current_user.token`) are always excluded from analytics. Everything else you reference is logged as-is, so avoid surfacing values that may contain personal data or other sensitive content. +{: .warning} + ## Steps A step represents a single HTTP request. Steps run sequentially within a flow. diff --git a/src/docs/images/help/mcp-servers/mcp-servers-logs.png b/src/docs/images/help/mcp-servers/mcp-servers-logs.png new file mode 100644 index 00000000..0fae9a3f Binary files /dev/null and b/src/docs/images/help/mcp-servers/mcp-servers-logs.png differ