Skip to main content
Glama
YeomYuJun

Remote Memory MCP Server

by YeomYuJun

create_relations

Creates relationships between entities in a knowledge graph stored remotely on GitHub for collaborative data management.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYes

Implementation Reference

  • src/index.ts:108-129 (registration)
    Tool registration in the list of tools provided to 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'],
      },
    },
  • MCP tool handler function that processes the create_relations tool call: delegates to memoryManager, handles sync, and formats 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),
        }],
      };
    }
  • Switch case in CallToolRequestSchema handler that routes 'create_relations' to its handler function.
    case 'create_relations':
      return await this.handleCreateRelations(args);
  • Core implementation in MemoryGraphManager that adds relations to the 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();
    }
  • Input schema definition for the create_relations tool, specifying the expected arguments structure.
    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'],
    },

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