Skip to main content
Glama

run_component

Execute a Haystack component by specifying its type, parameters, and input data to test its behavior and outputs.

Instructions

Run a Haystack component with the given parameters.

This tool allows you to execute a Haystack component by providing its type and initialization parameters, then passing input data to get results. Use this to test components and see how they would work in your pipeline. :param component_type: The type of component to run (e.g., "haystack.components.builders.prompt_builder.PromptBuilder") :param init_params: Initialization parameters for the component :param input_data: Input data for the component :param input_types: Optional type information for inputs (inferred if not provided). For custom types use the full import path (e.g. haystack.dataclasses.document.Document for Document)

:returns: Dictionary containing the component's outputs or error message string

All parameters accept object references in the form @obj_id or @obj_id.path.to.value.

Examples::

# Direct call with values
run_component(data={'key': 'value'}, threshold=10)

# Call with references
run_component(data='@obj_123', threshold='@obj_456.config.threshold')

# Mixed call
run_component(data='@obj_123.items', threshold=10)The output is automatically stored and can be referenced in other functions.

Returns a formatted preview with an object ID (e.g., @obj_123). Use the object store tools in combination with the object ID to view nested properties of the object. Use the returned object ID to pass this result to other functions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
component_typeYes
init_paramsNo
input_dataNo
input_typesNo
Behavior4/5

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

No annotations are provided, so the description carries full burden. It explains that output is stored as an object reference with an ID, how to use references in inputs, and that error messages are returned. However, it lacks details on side effects, authentication needs, or specific error conditions.

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

Conciseness4/5

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

The description is structured with sections for parameters, returns, and examples. It is front-loaded with purpose. While relatively long, every sentence adds value, and the structure aids readability.

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

Completeness5/5

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

Given 4 parameters and no output schema, the description provides thorough guidance on inputs, output format (object reference), usage patterns with references, and return structure. It is complete enough for correct invocation.

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

Parameters5/5

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

Schema description coverage is 0%, so description compensates fully. Each parameter is explained with purpose, format, and examples. It notes that input_types can be inferred and explains object reference syntax. This adds significant meaning beyond the raw schema.

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: 'Run a Haystack component with the given parameters.' It explains execution and testing use case, and the name and description distinguish it from sibling tools which deal with pipelines, indices, etc., not component execution.

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 says 'Use this to test components and see how they would work in your pipeline,' giving clear context. It does not explicitly state when not to use or mention alternatives, but given the unique nature of the tool among siblings, this is acceptable.

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/deepset-ai/deepset-mcp-server'

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