Skip to main content
Glama

log

Create or update today's daily log file with notes and tags to organize personal knowledge and build connections between entries.

Instructions

Create or update today's daily log file. Optionally add notes to the log.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesYes
tagsYesTags must follow these rules: - Can contain letters, numbers, underscore (_), hyphen (-), and forward slash (/) - Must contain at least one non-numerical character - Cannot contain spaces (use camelCase, PascalCase, snake_case, or kebab-case) - Are case-insensitive (stored as lowercase) Analyze the note's content and identify key themes, concepts, and categories that connect it to other notes. Consider: - Core topics and themes present in the note - Broader domains or areas of knowledge - Types of information (decisions, ideas, research, etc.) - Projects or contexts that might want to reference this later Do not force tags - only add ones that naturally emerge from the content and would help build meaningful connections between notes.

Implementation Reference

  • Registration of the 'log' tool, defining its name, description, and input schema.
    {
      name: "log",
      description: "Create or update today's daily log file. Optionally add notes to the log.",
      inputSchema: {
        type: "object",
        properties: {
          notes: { 
            type: "string"
          },
          tags: { 
            type: "array",
            items: { type: "string" },
            description: `${TAG_VALIDATION_DESCRIPTION}
    
              Analyze the note's content and identify key themes, concepts, and categories that connect it to other notes.
              Consider:
              - Core topics and themes present in the note
              - Broader domains or areas of knowledge
              - Types of information (decisions, ideas, research, etc.)
              - Projects or contexts that might want to reference this later
              Do not force tags - only add ones that naturally emerge from the content and would help build meaningful connections between notes.`
          }
        },
        required: ["notes", "tags"]
      }
    },
  • The handler function for the 'log' tool within handleToolCall, which processes arguments, creates LogNote instance, adds tags, appends entry, and returns result.
    case "log": {
      try {
        const logArgs = args as LogArgs;
        
        // Create LogNote without tags first
        const logNote = new LogNote(notesPath);
        
        await logNote.load();
        
        try {
          // Add tags separately to handle validation errors
          if (logArgs.tags && logArgs.tags.length > 0) {
            logNote.addTags(logArgs.tags);
          }
          
          const result = await logNote.appendEntry(logArgs.notes);
          
          if (!result.success) {
            return {
              content: [{ type: "text", text: `Error creating log: ${result.error}` }],
              isError: true,
            };
          }
          
          return {
            content: [{ 
              type: "text", 
              text: `I've added your note to today's log at ${result.path}.`
            }],
          };
        } catch (tagError) {
          // Specific handling for tag validation errors
          const errorMessage = tagError instanceof Error ? tagError.message : String(tagError);
          return {
            content: [{ type: "text", text: errorMessage }],
            isError: true,
          };
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text", text: `Error in log command: ${errorMessage}` }],
          isError: true,
        };
      }
    }
  • Core helper method in LogNote class that appends a new entry to the daily log file, handling loading, templating, and saving.
    async appendEntry(entry: string) {
      // Load existing content if available
      if (!this.exists) {
        await this.load();
        
        // If still no content, load template
        if (!this.template) {
          await this.loadTemplate();
        }
        
        if (!this.content && this.template) {
          this.content = this.template;
        }
      }
      
      // Add the entry
      this.addEntry(entry);
      
      // Save the updated note
      return await this.save();
    }
  • LogNote class constructor that sets up the daily log file path and initial template.
    export class LogNote extends Note {
      template: string;
    
      constructor(notesBasePath: string, options: LogNoteOptions = {}) {
        const date = options.date || new Date();
        const dateInfo = {
          dayOfWeek: format(date, 'EEEE'),
          fullDate: format(date, 'MMMM d, yyyy'),
          isoDate: format(date, 'yyyy-MM-dd'),
          time: format(date, 'h:mm a')
        };
        
        // Log notes always go in the Log directory with date-based filename
        const relativePath = path.join('Log', `${dateInfo.isoDate}.md`);
        
        super(notesBasePath, relativePath, { 
          ...options, 
          date 
        });
        
        this.template = `# ${this.dateInfo.dayOfWeek}, ${this.dateInfo.fullDate}\n\n`;
      }
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. It mentions 'create or update' which implies mutation, but doesn't specify whether this overwrites existing logs, merges content, requires specific permissions, or has rate limits. The description lacks crucial behavioral context for a mutation tool.

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

Conciseness4/5

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

The description is appropriately concise with two clear sentences. It's front-loaded with the core purpose. However, the second sentence about 'optionally' adding notes contradicts the schema's required parameters, which creates inefficiency.

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 2 required parameters, 50% schema coverage, and no annotations or output schema, the description is inadequate. It doesn't explain what 'today's daily log file' means (format, location, naming convention), what 'create or update' entails behaviorally, or what happens when the tool executes.

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% (only 'tags' has a description). The description mentions 'Optionally add notes to the log' which implies the 'notes' parameter is optional, but the schema shows it as required. This creates confusion. The description adds minimal semantic value beyond what's in the schema, not compensating for the coverage gap.

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 tool's purpose: 'Create or update today's daily log file' specifies the verb (create/update) and resource (today's daily log file). It distinguishes from sibling tools like 'write_note' by focusing specifically on daily logs rather than general notes. However, it doesn't fully differentiate from 'rollup' which might also aggregate content.

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. There's no mention of when to choose 'log' over 'write_note' or 'rollup', nor any prerequisites or exclusions. The agent must infer usage from the tool name and description alone.

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/mikeysrecipes/mcp-notes'

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