Langfuse MCP by usefulapi

v1.2.1
io.usefulapi/langfuse Checked 1 day ago Published 1 hour ago

Read traces, metrics, scores, prompts and datasets; add scores to traces in Langfuse.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

langfuse_get_project Get the connected project

Get the Langfuse project this key pair belongs to (id and name). Good first call to confirm the connection. Langfuse API: GET /api/public/projects.

langfuse_list_observations List observations (and traces)

List observations, the spans, generations and events of your LLM traces, newest first. Set is_root_observation to true to list traces (one root observation per trace). Use fields to choose response groups (default core,basic; add io, usage, model, metadata when needed). Langfuse API: GET /api/public/v2/observations.

ParameterTypeDescription
cursorstringCursor from meta.cursor of the previous page.
environmentstringOnly this environment, for example production.
fieldsstringComma-separated field groups: core, basic, time, io, metadata, model, usage, prompt, metrics, trace_context.
filterstringAdvanced filter: a JSON array of conditions, for example [{"type":"string","column":"name","operator":"contains","value":"rag"}].
from_start_timestringOnly observations that start at or after this time.
is_root_observationbooleantrue = only root observations (one per trace).
levelstringOnly this log level.
limitintegerItems per page (default 50, max 100).
namestringOnly observations with this name.
parse_io_as_jsonbooleantrue = parse input and output strings as JSON.
session_idstringOnly observations of this session id.
to_start_timestringOnly observations that start before this time.
trace_idstringOnly observations of this trace id.
typestringObservation type, for example GENERATION, SPAN, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL.
user_idstringOnly observations of this user id.

langfuse_get_metrics Run a metrics query

Run an aggregate query for counts, token usage, cost, latency or scores over observations or scores. "query" is a JSON object with view (observations, scores-numeric, scores-boolean or scores-categorical), optional dimensions, metrics (each with measure and aggregation) and filters. Langfuse API: GET /api/public/v2/metrics.

ParameterTypeDescription
query *stringJSON object, for example {"view":"observations","metrics":[{"measure":"count","aggregation":"count"}]}.

langfuse_list_scores List scores

List scores (quality ratings from humans, the API or evaluators) on traces, observations or sessions. Filter by name, source, data type or the object scored. Langfuse API: GET /api/public/v3/scores.

ParameterTypeDescription
config_idstringOnly scores made with this score config id.
cursorstringCursor from meta.cursor of the previous page.
data_typestringOnly scores of this data type.
from_timestampstringISO 8601 time, for example 2026-11-01T00:00:00Z.
limitintegerItems per page (default 50, max 100).
namestringOnly scores with this name.
observation_idstringOnly scores on this observation id.
session_idstringOnly scores on this session id.
sourcestringOnly scores from this source.
to_timestampstringISO 8601 time, for example 2026-11-01T00:00:00Z.
trace_idstringOnly scores on this trace id.

langfuse_list_score_configs List score configs

List score configs: the named scores your project defines (data type, value range, categories). Langfuse API: GET /api/public/score-configs.

ParameterTypeDescription
limitintegerItems per page (default 50, max 100).
pageintegerPage number (default 1).

langfuse_list_prompts List prompts

List prompt names in the project, with their labels, tags and versions. Filter by name, label or tag. Langfuse API: GET /api/public/v2/prompts.

ParameterTypeDescription
from_updated_atstringISO 8601 time, for example 2026-11-01T00:00:00Z.
labelstringOnly prompts that carry this label, for example production.
limitintegerItems per page (default 50, max 100).
namestringOnly prompts with this name.
pageintegerPage number (default 1).
tagstringOnly prompts with this tag.
to_updated_atstringISO 8601 time, for example 2026-11-01T00:00:00Z.

langfuse_get_prompt Get a prompt

Get one prompt version: its text or chat messages, config, labels and tags. Pick a version number or a label (default: the latest). Langfuse API: GET /api/public/v2/prompts/{promptName}.

ParameterTypeDescription
prompt_name *stringThe prompt name (from langfuse_list_prompts).
labelstringLabel to resolve, for example production.
resolvebooleantrue = resolve linked prompt references in the text.
versionintegerVersion number.

langfuse_list_datasets List datasets

List evaluation datasets in the project. Langfuse API: GET /api/public/v2/datasets.

ParameterTypeDescription
limitintegerItems per page (default 50, max 100).
pageintegerPage number (default 1).

langfuse_get_dataset Get a dataset

Get one dataset by name: its description, metadata and item count. Langfuse API: GET /api/public/v2/datasets/{datasetName}.

ParameterTypeDescription
dataset_name *stringThe dataset name (from langfuse_list_datasets).

langfuse_list_dataset_items List dataset items

List the items (inputs and expected outputs) of datasets, filterable by dataset name or by the trace or observation they came from. Langfuse API: GET /api/public/dataset-items.

ParameterTypeDescription
dataset_namestringOnly items of this dataset.
limitintegerItems per page (default 50, max 100).
pageintegerPage number (default 1).
source_observation_idstringOnly items created from this observation id.
source_trace_idstringOnly items created from this trace id.
versionstringOnly items as they were at this time (ISO 8601).

langfuse_list_models List model definitions

List the model definitions used for cost and token tracking (name, match pattern, prices per unit). Langfuse API: GET /api/public/models.

ParameterTypeDescription
limitintegerItems per page (default 50, max 100).
pageintegerPage number (default 1).

langfuse_list_comments List comments

List comments that people left on traces, observations, sessions or prompts. Filter by object type, object id or author. Langfuse API: GET /api/public/comments.

ParameterTypeDescription
author_user_idstringOnly comments by this author user id.
limitintegerItems per page (default 50, max 100).
object_idstringOnly comments on this object id.
object_typestringFor example TRACE, OBSERVATION, SESSION or PROMPT.
pageintegerPage number (default 1).

langfuse_list_annotation_queues List annotation queues

List annotation queues: review queues where people score traces or observations by hand. Langfuse API: GET /api/public/annotation-queues.

ParameterTypeDescription
limitintegerItems per page (default 50, max 100).
pageintegerPage number (default 1).

langfuse_create_score Create a score

Add one score to a trace, observation or session, for example a quality rating from your own check. The value is a number for NUMERIC and BOOLEAN (0 or 1) scores, and text for CATEGORICAL and TEXT scores. Give trace_id, observation_id or session_id. This creates a new record each call. Langfuse API: POST /api/public/scores.

ParameterTypeDescription
name *stringScore name, for example quality or hallucination.
value *number | stringNumber for NUMERIC or BOOLEAN (0/1); text for CATEGORICAL or TEXT.
commentstringFree-text comment on the score.
config_idstringScore config id (from langfuse_list_score_configs).
data_typestringData type; inferred from config_id when given.
observation_idstringObservation id to score.
session_idstringSession id to score.
trace_idstringTrace id to score.