list_memory_labels
Retrieve all unique memory labels with their counts to gain an overview of the knowledge graph structure.
Instructions
List all unique memory labels currently in use with their counts (useful for getting an overview of the knowledge graph)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/index.ts:295-319 (handler)The main handler logic for the 'list_memory_labels' tool, which queries Neo4j to retrieve all unique memory labels with their counts and returns the result as JSON.case 'list_memory_labels': { if (!isListMemoryLabelsArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid list_memory_labels arguments'); } const query = ` MATCH (memory) WITH labels(memory) as nodeLabels UNWIND nodeLabels as label WITH label, count(*) as count ORDER BY count DESC, label RETURN collect({label: label, count: count}) as labels, sum(count) as totalMemories `; const result = await neo4j.executeQuery(query, {}); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/tools/definitions.ts:173-181 (registration)Tool registration in the tools array, defining name, description, and input schema.{ name: 'list_memory_labels', description: 'List all unique memory labels currently in use with their counts (useful for getting an overview of the knowledge graph)', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/types.ts:51-53 (schema)TypeScript interface defining the expected arguments for list_memory_labels (empty object).export interface ListMemoryLabelsArgs { // No arguments needed for this tool }
- src/types.ts:115-118 (schema)Type guard function for validating list_memory_labels arguments.export function isListMemoryLabelsArgs(args: unknown): args is ListMemoryLabelsArgs { // This tool doesn't require any arguments, so just check it's an object return typeof args === 'object' && args !== null; }