Skip to main content
Glama
j3k0

Elasticsearch Knowledge Graph for MCP

by j3k0

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

NameRequiredDescriptionDefault
descriptionNoFull zone description. Make it very descriptive and detailed.
nameYesZone name (cannot be 'default')
shortDescriptionNoShort 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

  • 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"] } },
  • 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}` }); }
  • 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; }

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/j3k0/mcp-brain-tools'

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