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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/tools/data_stream.py:11-21 (handler)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)
- src/risk_config.py:20-23 (helper)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", },