Skip to main content
Glama

create_relations

Creates relationships between entities in a knowledge graph to establish connections and structure data for remote memory management and collaboration.

Instructions

엔티티 간의 관계를 생성합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYes

Implementation Reference

  • src/index.ts:108-129 (registration)
    Registration of the 'create_relations' tool in the MCP server, including name, description, and input schema definition.
    { name: 'create_relations', description: '엔티티 간의 관계를 생성합니다', inputSchema: { type: 'object', properties: { relations: { type: 'array', items: { type: 'object', properties: { from: { type: 'string' }, to: { type: 'string' }, relationType: { type: 'string' }, }, required: ['from', 'to', 'relationType'], }, }, }, required: ['relations'], }, },
  • Primary MCP tool handler for 'create_relations' that invokes the memory manager, performs sync if enabled, and returns success response.
    private async handleCreateRelations(args: any) { this.memoryManager.createRelations(args.relations); const commitMessage = `feat: Add ${args.relations.length} relations`; await this.syncWithMessage(commitMessage); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: `Created ${args.relations.length} relations`, relations: args.relations, }, null, 2), }], }; }
  • Core handler logic in MemoryGraphManager that adds the provided relations to the in-memory graph with timestamps and updates metadata.
    createRelations(relations: Omit<Relation, 'createdAt'>[]): void { const now = new Date().toISOString(); relations.forEach(relation => { this.graph.relations.push({ ...relation, createdAt: now, }); }); this.updateMetadata(); }
  • TypeScript interface defining the structure of a Relation, used in the tool's input schema and graph storage.
    export interface Relation { from: string; to: string; relationType: string; createdAt: string; }
  • src/index.ts:382-383 (registration)
    Dispatch registration in the CallToolRequestSchema handler switch statement that routes to the specific handler.
    case 'create_relations': return await this.handleCreateRelations(args);

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