Skip to main content
Glama
avivsinai

langfuse-mcp

create_dataset_item

Add or update dataset items with input-output pairs for evaluating LLM applications in Langfuse. Supports upsert functionality with custom IDs and metadata linking.

Instructions

Create a new item in a dataset, or update if item_id already exists.

Dataset items store input/expected output pairs for evaluation. If item_id is provided
and already exists, the item will be updated (upsert behavior).

Args:
    ctx: Context object containing lifespan context with Langfuse client
    dataset_name: Name of the target dataset
    input: Input data for the item
    expected_output: Expected output for evaluation
    metadata: Optional custom metadata
    source_trace_id: Optional linked trace ID
    source_observation_id: Optional linked observation ID
    item_id: Optional custom ID (enables upsert)
    status: Item status (ACTIVE or ARCHIVED)

Returns:
    A dictionary containing the created/updated item details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_nameYesName of the dataset to add the item to
inputNoInput data for the dataset item (any JSON-serializable value)
expected_outputNoExpected output data for evaluation (any JSON-serializable value)
metadataNoOptional custom metadata as key-value pairs
source_trace_idNoOptional trace ID to link this item to
source_observation_idNoOptional observation ID to link this item to
item_idNoOptional custom ID for the item (for upsert behavior)
statusNoItem status (default: ACTIVE)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the upsert behavior (create or update) and mentions the tool's purpose in evaluation contexts. However, it lacks details on permissions needed, rate limits, error handling, or what happens if dataset_name doesn't exist, which are important for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core functionality in the first sentence. Each subsequent sentence adds necessary context without redundancy, and the Args/Returns sections are clearly formatted. There is no wasted text, making it efficient for an AI agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, mutation operation) and the presence of an output schema (which covers return values), the description is mostly complete. It explains the tool's purpose, upsert behavior, and parameter roles. However, without annotations, it could benefit from more behavioral context like error conditions or side effects, though the output schema mitigates some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by briefly explaining the role of parameters like item_id for upsert and input/expected_output for evaluation, but does not provide additional syntax, format, or usage details. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('create a new item', 'update if item_id already exists') and resource ('in a dataset'), and distinguishes it from siblings by specifying it handles dataset items (unlike create_dataset for datasets or delete_dataset_item for deletion). The mention of 'upsert behavior' further clarifies its unique functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage by explaining the upsert behavior (when to create vs. update based on item_id existence) and mentions that dataset items store 'input/expected output pairs for evaluation'. However, it does not explicitly state when to use alternatives like delete_dataset_item or list_dataset_items, or any prerequisites beyond the required dataset_name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/avivsinai/landfuse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server