feat: Add observability tools (traces, scores, datasets, sessions)#15
Open
JaviMaligno wants to merge 1 commit into
Open
feat: Add observability tools (traces, scores, datasets, sessions)#15JaviMaligno wants to merge 1 commit into
JaviMaligno wants to merge 1 commit into
Conversation
Add 22 new tools for accessing Langfuse observability data: Traces (2 tools): - list-traces: List traces with filtering and pagination - get-trace: Get a specific trace with observations and scores Observations (2 tools): - list-observations: List observations with filtering - get-observation: Get a specific observation Scores (4 tools): - create-score: Create scores (numeric, boolean, categorical) - list-scores: List scores with filtering - get-score: Get a specific score - delete-score: Delete a score Score Configs (3 tools): - create-score-config: Create score configuration templates - list-score-configs: List all score configurations - get-score-config: Get a specific score configuration Datasets (9 tools): - create-dataset: Create a new dataset - list-datasets: List all datasets - get-dataset: Get a dataset by name - create-dataset-item: Create or update dataset items - list-dataset-items: List items in a dataset - get-dataset-item: Get a specific dataset item - create-dataset-run-item: Link traces to dataset items - list-dataset-runs: List runs for a dataset - get-dataset-run: Get a specific dataset run Sessions (2 tools): - list-sessions: List all sessions - get-session: Get a session with its traces Key features: - Uses Langfuse SDK api namespace for type-safe API calls - Type coercion with z.coerce.number() for MCP string parameters - includeIO parameter on get operations to control response size - Modular structure in src/tools/ directory Closes langfuse#14 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 22 new tools for accessing Langfuse observability data, addressing Issue #14 and Discussion #5646.
Tools Added
list-traces,get-tracelist-observations,get-observationcreate-score,list-scores,get-score,delete-scorecreate-score-config,list-score-configs,get-score-configcreate-dataset,list-datasets,get-dataset,create-dataset-item,list-dataset-items,get-dataset-item,create-dataset-run-item,list-dataset-runs,get-dataset-runlist-sessions,get-sessionKey Features
apinamespace for type-safe API calls (as suggested by @marcklingen)z.coerce.number()to handle MCP clients that pass stringsincludeIOparameter on get operations to control response size (prevents exceeding LLM context limits)src/tools/directory for maintainabilityStructure
Testing
Test Plan
npm run build)list-tracesreturns paginated trace listget-tracereturns trace with observations and scorescreate-scorecreates a score on a tracelist-datasetsreturns dataset listget-sessionreturns session with tracesCloses #14
🤖 Generated with Claude Code