create_zone
Define and organize memory zones in the Elasticsearch Knowledge Graph for MCP, enabling structured storage and retrieval of detailed information with custom descriptions and names.
Instructions
Create a new memory zone with optional description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Full zone description. Make it very descriptive and detailed. | |
| name | Yes | Zone name (cannot be 'default') | |
| shortDescription | No | Short description of the zone. |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"description": "Full zone description. Make it very descriptive and detailed.",
"type": "string"
},
"name": {
"description": "Zone name (cannot be 'default')",
"type": "string"
},
"shortDescription": {
"description": "Short description of the zone.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Implementation Reference
- src/index.ts:487-508 (schema)Tool schema definition for 'create_zone' including input validation schema, registered in the listTools response.{ name: "create_zone", description: "Create a new memory zone with optional description.", inputSchema: { type: "object", properties: { name: { type: "string", description: "Zone name (cannot be 'default')" }, shortDescription: { type: "string", description: "Short description of the zone." }, description: { type: "string", description: "Full zone description. Make it very descriptive and detailed." } }, required: ["name"] } },
- src/index.ts:1164-1181 (handler)MCP tool handler for 'create_zone': extracts name and description parameters, calls kgClient.addMemoryZone, and formats success/error response.else if (toolName === "create_zone") { const name = params.name; const description = params.description; try { await kgClient.addMemoryZone(name, description); return formatResponse({ success: true, zone: name, message: `Zone "${name}" created successfully` }); } catch (error) { return formatResponse({ success: false, error: `Failed to create zone: ${(error as Error).message}` }); }
- src/kg-client.ts:1427-1446 (helper)Core implementation of zone creation: validates name, initializes index, saves metadata, updates cache.async addMemoryZone( zone: string, description?: string, config?: Record<string, any> ): Promise<boolean> { if (!zone || zone === 'default') { throw new Error('Invalid zone name. Cannot be empty or "default".'); } // Initialize the index for this zone await this.initialize(zone); // Add to metadata await this.saveZoneMetadata(zone, description, config); // Update the cache this.existingZonesCache[zone] = true; return true; }