Skip to main content
Glama

run_component

Execute a Haystack component by providing its type and parameters, then pass input data to test its behavior before integrating into a pipeline.

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?

Discloses that output is automatically stored, returns object IDs, and points to object store tools. Describes error return as string. No annotations provided, so description carries burden well. Lacks mention of side effects or performance implications.

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?

Well-structured with sections, examples, and front-loaded purpose. Slightly verbose but every sentence adds value.

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?

Covers output format, object references, and integration with other tools. No output schema, so returns explained. Could mention potential side effects or state modifications.

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 has 0% description coverage, but description fully explains all four parameters with types, defaults, and object reference syntax. Examples clarify usage.

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 that the tool runs a Haystack component with given parameters, using specific verb 'Run' and resource 'Haystack component'. It distinguishes from sibling tools which are about pipelines, indexes, and workspaces.

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?

Provides clear context: 'Use this to test components and see how they would work in your pipeline.' Does not explicitly list when not to use or name alternatives, but context is strong.

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