Skip to main content
Glama
BRO3886

Memory Custom

by BRO3886

add_observations

Add new observations to existing entities in a knowledge graph by specifying entity names and observation contents with a memory file path.

Instructions

Add new observations to existing entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observationsYes
memoryFilePathYesThe path to the memory file

Implementation Reference

  • Core handler logic in KnowledgeGraphManager.addObservations: loads graph from file, finds entities, adds unique observations, saves updated graph, returns added observations per entity.
    async addObservations(
      observations: { entityName: string; contents: string[] }[],
      filepath: string
    ): Promise<{ entityName: string; addedObservations: string[] }[]> {
      await this.setMemoryFilePath(filepath);
      const graph = await this.loadGraph();
      const results = observations.map((o) => {
        const entity = graph.entities.find((e) => e.name === o.entityName);
        if (!entity) {
          throw new Error(`Entity with name ${o.entityName} not found`);
        }
        const newObservations = o.contents.filter(
          (content) => !entity.observations.includes(content)
        );
        entity.observations.push(...newObservations);
        return { entityName: o.entityName, addedObservations: newObservations };
      });
      await this.saveGraph(graph);
      return results;
    }
  • Input schema definition for the add_observations tool, specifying structure for observations array (with entityName and contents) and memoryFilePath.
    {
      name: "add_observations",
      description:
        "Add new observations to existing entities in the knowledge graph",
      inputSchema: {
        type: "object",
        properties: {
          observations: {
            type: "array",
            items: {
              type: "object",
              properties: {
                entityName: {
                  type: "string",
                  description:
                    "The name of the entity to add the observations to",
                },
                contents: {
                  type: "array",
                  items: { type: "string" },
                  description: "An array of observation contents to add",
                },
              },
              required: ["entityName", "contents"],
            },
          },
          memoryFilePath: {
            type: "string",
            description: "The path to the memory file",
          },
        },
        required: ["observations", "memoryFilePath"],
      },
    },
  • index.ts:634-652 (registration)
    Registration in the tool dispatcher switch statement: handles CallToolRequest for add_observations by calling the KnowledgeGraphManager method and returning JSON-formatted result.
    case "add_observations":
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              await knowledgeGraphManager.addObservations(
                args.observations as {
                  entityName: string;
                  contents: string[];
                }[],
                args.memoryFilePath as string
              ),
              null,
              2
            ),
          },
        ],
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool adds observations but does not cover critical aspects such as whether this is a mutation (implied by 'Add'), potential side effects (e.g., overwriting existing observations), authentication needs, error handling, or rate limits. This is inadequate for a tool that modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a mutation tool with no annotations, no output schema, and incomplete parameter coverage (50%), the description is insufficient. It fails to address behavioral traits, return values, or detailed usage scenarios, leaving the agent with significant gaps in understanding how to invoke and interpret results from this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%, with 'observations' and 'memoryFilePath' documented in the schema but lacking details in the description. The description adds minimal value by hinting at the purpose ('Add new observations to existing entities'), but does not elaborate on parameter semantics beyond what the schema provides, such as format expectations for 'entityName' or 'memoryFilePath'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add new observations') and target ('to existing entities in the knowledge graph'), distinguishing it from siblings like 'create_entities' or 'delete_observations' by focusing on updating existing entities. However, it lacks specificity about what 'observations' entail (e.g., text notes, metadata), which slightly reduces clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for adding observations to existing entities but provides no explicit guidance on when to use this tool versus alternatives like 'create_entities' or 'delete_observations', nor does it mention prerequisites (e.g., entities must already exist). This leaves gaps in contextual decision-making for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/BRO3886/mcp-memory-custom'

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