Skip to main content
Glama

get_entity_names

Retrieve entity names from a knowledge graph with filtering and sorting options to quickly identify available data entries.

Instructions

엔티티 이름 목록만 조회합니다 (가볍고 빠름)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityTypeNo특정 엔티티 타입으로 필터링
sortByNo정렬 기준 (기본값: createdAt)
sortOrderNo정렬 순서 (기본값: desc)

Implementation Reference

  • The handler function that processes the get_entity_names tool call, invokes memoryManager.getEntityNames with parameters, and returns a formatted JSON response.
    private async handleGetEntityNames(args: any) { const names = this.memoryManager.getEntityNames({ entityType: args.entityType, sortBy: args.sortBy, sortOrder: args.sortOrder, }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, names: names, count: names.length, filters: { entityType: args.entityType || 'all', sortBy: args.sortBy || 'createdAt', sortOrder: args.sortOrder || 'desc', }, }, null, 2), }], }; }
  • Defines the tool name, description, and input schema in the ListTools response.
    { name: 'get_entity_names', description: '엔티티 이름 목록만 조회합니다 (가볍고 빠름)', inputSchema: { type: 'object', properties: { entityType: { type: 'string', description: '특정 엔티티 타입으로 필터링' }, sortBy: { type: 'string', enum: ['createdAt', 'updatedAt', 'name'], description: '정렬 기준 (기본값: createdAt)' }, sortOrder: { type: 'string', enum: ['asc', 'desc'], description: '정렬 순서 (기본값: desc)' } }, }, },
  • src/index.ts:398-399 (registration)
    Switch case in CallToolRequest handler that routes get_entity_names calls to the specific handler function.
    case 'get_entity_names': return await this.handleGetEntityNames(args);
  • Helper method in MemoryGraphManager that filters entities by type, sorts them according to options, and returns only the entity names.
    getEntityNames(options?: { entityType?: string; sortBy?: 'createdAt' | 'updatedAt' | 'name'; sortOrder?: 'asc' | 'desc'; }): string[] { let entities = Array.from(this.graph.entities.values()); if (options?.entityType) { entities = entities.filter(e => e.entityType === options.entityType); } const sortBy = options?.sortBy || 'createdAt'; const sortOrder = options?.sortOrder || 'desc'; entities.sort((a, b) => { let aVal: string, bVal: string; if (sortBy === 'name') { aVal = a.name; bVal = b.name; } else { aVal = a[sortBy]; bVal = b[sortBy]; } const comparison = aVal.localeCompare(bVal); return sortOrder === 'asc' ? comparison : -comparison; }); return entities.map(e => e.name); }

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/YeomYuJun/remote-memory-mcp-server'

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