Skip to main content
Glama
StevenWangler

MCP Memory Server

add_observations

Enhance entities in the MCP Memory Server's knowledge graph by adding new observations, enabling LLMs to store and utilize updated information across conversations and sessions.

Instructions

Add new observations to existing entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observationsYes

Implementation Reference

  • Core implementation of the add_observations tool: loads the knowledge graph, adds new non-duplicate observations to specified entities, persists changes, and returns added observations per entity.
    async addObservations(observations: { entityName: string; contents: string[] }[]): Promise<{ entityName: string; addedObservations: string[] }[]> {
      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;
    }
  • src/index.ts:388-389 (registration)
    Dispatcher in CallToolRequestSchema handler that routes 'add_observations' calls to the KnowledgeGraphManager.addObservations method.
    case "add_observations":
      return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.addObservations(args.observations as { entityName: string; contents: string[] }[]), null, 2) }] };
  • Input schema for validating parameters of the add_observations tool.
    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"],
          },
        },
      },
      required: ["observations"],
    },
  • src/index.ts:250-274 (registration)
    Tool registration entry in ListToolsRequestSchema response, defining name, description, and input schema for add_observations.
    {
      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"],
            },
          },
        },
        required: ["observations"],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It states the action ('Add') but doesn't disclose permissions needed, whether it's idempotent, rate limits, error handling, or what happens if entities don't exist. This is inadequate for a mutation tool with zero annotation coverage.

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 with no wasted words. It's front-loaded with the core action and resource, making it easy 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 complexity (mutation tool with nested parameters), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavior, error cases, return values, and usage context, making it insufficient for safe and effective tool invocation.

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 0%, so the description must compensate but adds minimal param semantics. It implies 'observations' and 'entities' are involved but doesn't explain parameter structure, data formats, or constraints beyond what the schema defines. Baseline 3 applies as it hints at the general purpose without detailed compensation.

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 verb ('Add') and resource ('observations to existing entities in the knowledge graph'), making the purpose understandable. It distinguishes from siblings like 'create_entities' (new entities) and 'delete_observations' (removal), but doesn't explicitly contrast with 'search_nodes' or 'read_graph' for observation retrieval.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., entities must exist), exclusions (e.g., cannot add to non-existent entities), or compare to siblings like 'create_entities' for new entities with observations.

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

Related 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/StevenWangler/mcp-memory-server'

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