Skip to main content
Glama

run_component

Run a Haystack component with custom parameters to test its behavior and get 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) :param haystack_version: Optional version of Haystack to use for the component. Pass the same version as specified in the pipeline yaml's dependencies section for the haystack-ai package.

: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
input_dataNo
init_paramsNo
input_typesNo
component_typeYes
haystack_versionNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.1.25
    • addedInput schema / properties / haystack_version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Haystack Version"
      +}
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It transparently explains that outputs are stored and returned as object IDs, supports object references, and notes error message returns. It does not mention side effects or resource implications, but the execution nature is clear.

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 long but well-structured with clear sections: purpose, parameters, examples, and output behavior. It front-loads the core purpose and uses formatting (code blocks, :param tags) to improve readability. Some redundancy exists (e.g., repetition of 'output is automatically stored') but overall it is efficient.

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 the tool's complexity (5 params, no output schema) and lack of annotations, the description is remarkably complete. It covers parameter semantics, object reference syntax, output storage and retrieval via object ID, error handling, and versioning considerations. It leaves no significant gaps for an agent to misuse the tool.

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 the description must fully compensate. It explains each parameter (component_type, init_params, input_data, input_types, haystack_version) and provides concrete examples with object references and error handling. This far exceeds the schema's minimal type-only definitions.

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 function: 'Run a Haystack component with the given parameters' and elaborates on executing components to get results. It distinguishes itself from sibling tools by focusing on component execution/testing rather than pipeline management or object store operations.

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 explicit usage context ('Use this to test components and see how they would work in your pipeline') and gives practical examples. However, it does not explicitly mention when not to use this tool or suggest alternative tools for related tasks, though the sibling list makes the context clear.

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

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