---
canonical_url: "https://docs.composio.dev/toolkits/langfuse"
markdown_url: "https://docs.composio.dev/toolkits/langfuse.md"
product: "platform"
version: null
last_updated: null
---

# Langfuse

Open source LLM engineering platform. Traces, evals, prompt management and metrics to debug and improve your LLM application.

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 13
- **Triggers:** 0
- **Slug:** `LANGFUSE`
- **Version:** 00000000_00

## Tools

### Create Score

**Slug:** `LANGFUSE_CREATE_SCORE`

Attach an evaluation score to exactly one Langfuse trace, session, or dataset run, optionally narrowing a trace score to an observation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Score name. |
| `value` | string | Yes | Numeric value for NUMERIC or BOOLEAN scores (BOOLEAN uses 1 or 0), or a string for CATEGORICAL, TEXT, or CORRECTION scores. |
| `source` | string ("API" | "ANNOTATION") | No | Score source. ANNOTATION requires config_id unless data_type is CORRECTION. |
| `comment` | string | No | Human-readable explanation of the score. |
| `metadata` | object | No | Arbitrary JSON metadata to associate with the score. |
| `queue_id` | string | No | Annotation queue associated with this score. |
| `score_id` | string | No | Optional caller-supplied score ID. |
| `trace_id` | string | No | Trace target. May be combined with observation_id. |
| `config_id` | string | No | Score configuration ID used to validate and infer compatible score fields. |
| `data_type` | string ("NUMERIC" | "BOOLEAN" | "CATEGORICAL" | "TEXT" | "CORRECTION") | No | Score data type. Langfuse infers it when config_id is set; otherwise it defaults to NUMERIC. |
| `session_id` | string | No | Session target. |
| `environment` | string | No | Lowercase alphanumeric environment with hyphens or underscores; must not start with 'langfuse'. |
| `dataset_run_id` | string | No | Dataset run or experiment target. |
| `observation_id` | string | No | Observation target within trace_id. Cannot be used alone. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Annotation Queue

**Slug:** `LANGFUSE_GET_ANNOTATION_QUEUE`

Retrieve one Langfuse annotation queue by its ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `queue_id` | string | Yes | Unique identifier of the annotation queue to retrieve. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Prompt

**Slug:** `LANGFUSE_GET_PROMPT`

Retrieve a Langfuse text or chat prompt by name, deployment label, or exact version, with optional dependency resolution.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `label` | string | No | Deployment label. Cannot be combined with version; defaults upstream to production when neither selector is set. |
| `resolve` | boolean | No | Resolve prompt dependencies. Set false only to inspect the raw stored prompt. |
| `version` | integer | No | Exact prompt version. Cannot be combined with label. |
| `prompt_name` | string | Yes | Prompt name, including any folder path. Folder separators are URL-encoded as part of the path value. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Annotation Queues

**Slug:** `LANGFUSE_LIST_ANNOTATION_QUEUES`

List annotation queues configured for human evaluation in the connected Langfuse project.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum queues in this page. |
| `next_cursor` | string | No | Continuation token returned by the previous call; do not construct it manually. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Dataset Items

**Slug:** `LANGFUSE_LIST_DATASET_ITEMS`

List dataset items, optionally scoped to a dataset, source trace or observation, or historical dataset version.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum dataset items in this page. |
| `version` | string | No | Return the dataset state at this UTC RFC 3339 timestamp. Requires dataset_name. |
| `next_cursor` | string | No | Continuation token returned by the previous call. Omit for the first page and do not construct it manually. |
| `dataset_name` | string | No | Dataset name to list items from. |
| `source_trace_id` | string | No | Filter by source trace ID. |
| `source_observation_id` | string | No | Filter by source observation ID. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Dataset Run Items

**Slug:** `LANGFUSE_LIST_DATASET_RUN_ITEMS`

List run items for a specific Langfuse dataset and run name.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Provider page number, starting at 1. |
| `limit` | integer | No | Maximum run items to return on this page. |
| `runName` | string | Yes | Dataset run name to filter by. |
| `datasetId` | string | Yes | Unique identifier of the dataset to filter by. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Datasets

**Slug:** `LANGFUSE_LIST_DATASETS`

List datasets available to the connected Langfuse project.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum datasets in this page. |
| `next_cursor` | string | No | Continuation token returned by the previous call; do not construct it manually. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Experiments

**Slug:** `LANGFUSE_LIST_EXPERIMENTS`

List Langfuse experiments active in a required time range, optionally including metadata and directly attached scores.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum experiments in this page (1-100). |
| `names` | string | No | Comma-separated experiment names. |
| `fields` | string | No | Comma-separated field groups to return: core, metadata, scores. |
| `dataset_ids` | string | No | Comma-separated dataset IDs. |
| `filter_json` | string | No | JSON-encoded structured filters over id, name, and datasetId. |
| `next_cursor` | string | No | Continuation cursor returned by the previous call. Omit for the first page. |
| `score_limit` | integer | No | Maximum attached scores per experiment when fields includes scores (1-50). |
| `to_start_time` | string | No | Include experiments starting before this ISO 8601 timestamp. |
| `experiment_ids` | string | No | Comma-separated experiment IDs. |
| `from_start_time` | string | Yes | Include experiments active on or after this ISO 8601 timestamp. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Models

**Slug:** `LANGFUSE_LIST_MODELS`

List Langfuse-managed and project-custom model pricing definitions used for usage and cost calculation.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum model definitions in this page. |
| `next_cursor` | string | No | Continuation token returned by the previous call. Omit for the first page and do not construct this token manually. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Observations

**Slug:** `LANGFUSE_LIST_OBSERVATIONS`

Search Langfuse observations such as generations, spans, events, agents, and tool calls, selecting only the field groups needed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | Filter by observation name. |
| `level` | string ("DEBUG" | "DEFAULT" | "WARNING" | "ERROR") | No | Filter by observation level. |
| `limit` | integer | No | Maximum observations in this page (1-1000). |
| `fields` | string | No | Comma-separated field groups to return: core, basic, time, io, metadata, model, usage, prompt, metrics, trace_context. |
| `user_id` | string | No | Filter by associated user ID. |
| `version` | string | No | Filter by observation version. |
| `trace_id` | string | No | Filter by trace ID. |
| `session_id` | string | No | Filter by session ID. |
| `filter_json` | string | No | JSON-encoded structured filter array. When set, it takes precedence over individual filters. |
| `next_cursor` | string | No | Continuation cursor returned by the previous call. Omit for the first page. |
| `environments` | array | No | Return observations from any of these environments. |
| `to_start_time` | string | No | Include observations starting before this ISO 8601 timestamp. |
| `expand_metadata` | string | No | Comma-separated metadata keys whose values should not be truncated. |
| `from_start_time` | string | No | Include observations starting at or after this ISO 8601 timestamp. |
| `observation_type` | string ("GENERATION" | "SPAN" | "EVENT" | "AGENT" | "TOOL" | "CHAIN" | "RETRIEVER" | "EVALUATOR" | "EMBEDDING" | "GUARDRAIL") | No | Filter by observation type. |
| `is_root_observation` | boolean | No | Filter by logical root status. |
| `parent_observation_id` | string | No | Filter by physical parent observation ID. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Scores

**Slug:** `LANGFUSE_LIST_SCORES`

Search numeric, boolean, categorical, text, and correction scores with subject and annotation context.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum scores in this page (1-100); larger values are rejected. |
| `names` | array | No | Score names to return. |
| `fields` | array | No | Optional score field groups to include. |
| `values` | array | No | Exact score values to match; requires one compatible data type. |
| `sources` | array | No | Score sources to return. |
| `queue_ids` | array | No | Annotation queue IDs to return. |
| `score_ids` | array | No | Score IDs to return. |
| `trace_ids` | array | No | Trace IDs to return; mutually exclusive with session and experiment IDs. |
| `value_max` | number | No | Inclusive numeric upper bound; requires data_types=NUMERIC. |
| `value_min` | number | No | Inclusive numeric lower bound; requires data_types=NUMERIC. |
| `config_ids` | array | No | Score configuration IDs to return. |
| `data_types` | array | No | Score data types to return. |
| `next_cursor` | string | No | Continuation cursor returned by the previous call. |
| `session_ids` | array | No | Session IDs to return; mutually exclusive with trace, observation, and experiment IDs. |
| `environments` | array | No | Environments to return. |
| `to_timestamp` | string | No | Exclusive score timestamp upper bound. |
| `experiment_ids` | array | No | Dataset run or experiment IDs to return; mutually exclusive with other subject filters. |
| `from_timestamp` | string | No | Inclusive score timestamp lower bound. |
| `author_user_ids` | array | No | Annotation author user IDs to return. |
| `observation_ids` | array | No | Observation IDs to return; requires trace_ids. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Query Metrics

**Slug:** `LANGFUSE_QUERY_METRICS`

Run an aggregate Langfuse metrics query over observations or numeric, boolean, or categorical scores.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `view` | string ("observations" | "scores-numeric" | "scores-boolean" | "scores-categorical") | Yes | Langfuse data view to aggregate. |
| `filters` | array | No | Optional typed conditions used to restrict source rows. |
| `metrics` | array | Yes | One or more measures and aggregations to calculate. |
| `order_by` | array | No | Optional ordered list of result sort rules. |
| `row_limit` | integer | No | Maximum aggregate rows to return (1-1000). |
| `dimensions` | array | No | Optional low-cardinality fields by which to group results. |
| `to_timestamp` | string | Yes | Exclusive ISO 8601 end of the metrics time range; must be after from_timestamp. |
| `from_timestamp` | string | Yes | Inclusive ISO 8601 start of the metrics time range. |
| `histogram_bins` | integer | No | Number of histogram bins when using histogram aggregation (1-100). |
| `time_granularity` | string ("auto" | "minute" | "hour" | "day" | "week" | "month") | No | Optional time bucket granularity for grouping results. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Upsert LLM Connection

**Slug:** `LANGFUSE_UPSERT_LLM_CONNECTION`

Create or update a Langfuse LLM provider connection by provider name.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `config` | object | No | Adapter-specific configuration, such as a Bedrock region or Vertex AI location. |
| `adapter` | string ("anthropic" | "openai" | "azure" | "bedrock" | "google-vertex-ai" | "google-ai-studio") | Yes | Adapter used to call the LLM provider. |
| `baseURL` | string | No | Optional custom LLM provider or gateway base URL. |
| `provider` | string | Yes | Unique provider name used to create or update the connection. |
| `secretKey` | string | Yes | Secret credential Langfuse stores for the LLM provider. |
| `customModels` | array | No | Custom model names exposed through this connection. |
| `extraHeaders` | object | No | Additional headers sent to the LLM provider. |
| `withDefaultModels` | boolean | No | Whether to include the adapter's default models. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
