list_memory_labels
Retrieve all unique memory labels with their counts to understand the structure and content of your Neo4j knowledge graph.
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)Executes a Neo4j query to retrieve all unique memory labels with their counts and total number of memories, returning 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/types.ts:51-53 (schema)TypeScript interface defining the arguments for the list_memory_labels tool (empty object).export interface ListMemoryLabelsArgs { // No arguments needed for this tool }
- src/types.ts:115-118 (schema)Type guard function to validate arguments for list_memory_labels tool.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; }
- src/tools/definitions.ts:173-181 (registration)MCP tool registration defining the name, description, and input schema (no required properties).{ 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: [], }, },