Skip to main content
Glama
cr7258

Elasticsearch MCP Server

create_data_stream

Create a new Elasticsearch data stream by specifying its name, requiring a matching index template for proper setup and management.

Instructions

Create a new data stream.

        This creates a new data stream with the specified name.
        The data stream must have a matching index template before creation.
        
        Args:
            name: Name of the data stream to create
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The FastMCP tool handler function for create_data_stream, decorated with @mcp.tool(), which defines the input schema via type hints and docstring, and executes by calling the search client's create_data_stream method.
    @mcp.tool()
    def create_data_stream(name: str) -> Dict:
        """Create a new data stream.
        
        This creates a new data stream with the specified name.
        The data stream must have a matching index template before creation.
        
        Args:
            name: Name of the data stream to create
        """
        return self.search_client.create_data_stream(name=name)
  • Supporting client method in DataStreamClient that wraps the underlying search engine client's indices.create_data_stream call.
    def create_data_stream(self, name: str) -> Dict:
        """Create a new data stream."""
        return self.client.indices.create_data_stream(name=name)
  • src/server.py:43-54 (registration)
    Server initialization registers DataStreamTools by including it in the tool_classes list passed to ToolsRegister.register_all_tools, which instantiates the class and calls its register_tools method.
    # Define all tool classes to register
    tool_classes = [
        IndexTools,
        DocumentTools,
        ClusterTools,
        AliasTools,
        DataStreamTools,
        GeneralTools,
    ]        
    # Register all tools
    register.register_all_tools(tool_classes)
  • Configuration listing 'create_data_stream' as a high-risk operation for DataStreamTools, used by the risk manager to potentially disable it.
    "DataStreamTools": {
        "create_data_stream",
        "delete_data_stream",
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the creation action and a prerequisite (index template), but lacks details on permissions, error handling, rate limits, or what happens upon success/failure. For a mutation tool with zero annotation coverage, this is insufficient.

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 appropriately sized and front-loaded, with the main purpose stated first and additional details following. It uses three sentences efficiently, though the 'Args' section is somewhat redundant with the schema and could be integrated more smoothly.

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

Completeness2/5

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

Given the tool's complexity as a mutation operation, lack of annotations, no output schema, and minimal parameter details, the description is incomplete. It does not explain return values, error conditions, or behavioral nuances, leaving significant gaps for an AI agent to understand how to invoke it correctly.

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

Parameters4/5

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

The description adds meaning beyond the input schema by explaining that the 'name' parameter is for 'Name of the data stream to create.' With 0% schema description coverage and only one parameter, this compensates well, though it could provide more context on naming constraints or format.

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

Purpose4/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: 'Create a new data stream with the specified name.' It uses a specific verb ('create') and identifies the resource ('data stream'), but does not explicitly differentiate it from sibling tools like 'create_index' or 'index_document', which prevents a score of 5.

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

Usage Guidelines3/5

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

The description provides implied usage guidance by stating 'The data stream must have a matching index template before creation,' which suggests a prerequisite. However, it does not explicitly state when to use this tool versus alternatives like 'create_index' or 'delete_data_stream', nor does it provide exclusions or clear context for selection.

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/cr7258/elasticsearch-mcp-server'

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