Skip to main content
Glama

log

Create or update today's log file with notes and tags in MCP Notes. Tag entries to organize, connect, and enhance accessibility for future reference.

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 definition in getToolDefinitions(), including 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"]
      }
    },
  • TypeScript interface defining the input arguments for the 'log' tool.
    interface LogArgs {
      notes: string;
      tags?: string[];
    }
  • The handler function for the 'log' tool within handleToolCall, which instantiates LogNote, adds tags if provided, appends the notes entry, and returns success or error.
    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,
        };
      }
    }
  • LogNote class, extending Note, handles creation, loading, and appending timestamped entries to the daily log file. Used by the 'log' tool handler.
    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`;
      }
      
      addEntry(entry: string): LogNote {
        // If note doesn't exist yet, initialize with template
        if (!this.exists && !this.content && this.template) {
          this.content = this.template;
        }
        
        // Generate a fresh timestamp for this entry
        const currentTime = format(new Date(), 'h:mm a');
        
        // Add entry with fresh timestamp
        this.content += `\n### [${currentTime}]\n${entry}`;
        return this;
      }
      
      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();
      }
    
      // This method is referenced but not implemented in the original JS file
      // Adding it here for completeness
      async loadTemplate(): Promise<void> {
        try {
          // Implementation would depend on how templates are loaded
          // For now, we'll just use the default template
          this.template = `# ${this.dateInfo.dayOfWeek}, ${this.dateInfo.fullDate}\n\n`;
        } catch (error) {
          console.error("Error loading template:", error);
        }
      }
    }
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 mentions 'create or update' but doesn't clarify what happens if a log already exists, whether updates are destructive or additive, or any permissions, rate limits, or error handling. The description adds minimal context beyond the basic operation.

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 concise and front-loaded with the core purpose in the first sentence. The second sentence adds optional functionality without redundancy. Both sentences earn their place by clarifying the tool's scope, though it could be slightly more structured (e.g., by explicitly stating parameters).

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 tool has 2 required parameters, no annotations, no output schema, and 50% schema coverage, the description is incomplete. It doesn't explain what the tool returns, how errors are handled, or the full behavioral context for a mutation tool. The description alone is inadequate for safe and effective use by an AI agent.

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 the 'tags' parameter well-documented in the schema but 'notes' lacking description. The tool description adds no parameter semantics beyond what's in the schema—it mentions 'optionally add notes' but doesn't explain the 'notes' parameter's purpose or format. The baseline is 3 because the schema covers half the parameters, but the description doesn't compensate for the 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. Optionally add notes to the log.' This specifies the verb (create/update), resource (today's daily log file), and optional functionality (add notes). It distinguishes from siblings like 'write_note' by focusing on a daily log file rather than general notes, though it doesn't explicitly contrast with all siblings.

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 when to choose 'log' over 'write_note' or other sibling tools like 'create_directory' or 'search_files', nor does it specify prerequisites or exclusions. Usage is implied only by the tool's name and purpose.

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

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