Skip to main content
Glama
YuNaga224

Obsidian Memory MCP

by YuNaga224

add_observations

Add observations to entities in your knowledge graph to expand and update stored information for visualization in Obsidian.

Instructions

Add new observations to existing entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observationsYes

Implementation Reference

  • Core handler function that implements the add_observations tool logic: loads entity, filters duplicates, appends new observations, reloads relations, and saves the updated markdown file for each entity.
    async addObservations(observations: { entityName: string; contents: string[] }[]): Promise<{ entityName: string; addedObservations: string[] }[]> {
      const results: { entityName: string; addedObservations: string[] }[] = [];
      
      for (const obs of observations) {
        const entityPath = getEntityPath(obs.entityName);
        
        try {
          // Load current entity
          const entity = await this.loadEntity(entityPath);
          if (!entity) {
            throw new Error(`Entity ${obs.entityName} not found`);
          }
          
          // Filter out duplicate observations
          const newObservations = obs.contents.filter(
            content => !entity.observations.includes(content)
          );
          
          if (newObservations.length > 0) {
            // Update entity
            entity.observations.push(...newObservations);
            
            // Get current relations for this entity
            const graph = await this.loadGraph();
            const entityRelations = graph.relations.filter(r => r.from === entity.name);
            
            // Save updated entity
            await this.saveEntity(entity, entityRelations);
            
            results.push({
              entityName: obs.entityName,
              addedObservations: newObservations
            });
          }
        } catch (error) {
          throw new Error(`Failed to add observations to ${obs.entityName}: ${error}`);
        }
      }
      
      return results;
    }
  • Input schema defining the structure for add_observations tool: array of objects with entityName (string) and contents (array of strings).
    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"],
    },
  • index.ts:77-101 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      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"],
      },
    },
  • MCP server dispatch handler for add_observations tool call, which invokes the storage manager method and formats the response.
    case "add_observations":
      return { content: [{ type: "text", text: JSON.stringify(await storageManager.addObservations(args.observations as { entityName: string; contents: string[] }[]), null, 2) }] };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Add' implies a write/mutation operation, it doesn't specify permissions needed, whether changes are reversible, rate limits, or what happens if entities don't exist. This is a significant gap 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 zero wasted words. It's appropriately sized for a tool with one main parameter and gets straight to the point without unnecessary elaboration.

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?

For a mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is inadequate. It doesn't explain what constitutes valid observations, how they're stored, what the response looks like, or error conditions. More context is needed given the complexity of modifying a knowledge graph.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description mentions 'observations' and 'entities' but doesn't explain the structure, format, or constraints of the 'observations' array parameter. It adds minimal semantic context beyond what's implied by the tool name.

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'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'create_entities' or 'delete_observations', which would require more specific scope definition.

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 already exist), exclusions, or comparisons to sibling tools like 'create_entities' (for new entities) or 'delete_observations' (for removal).

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/YuNaga224/obsidian-memory-mcp'

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