Skip to main content
Glama
bezata

kObsidian MCP

Append Wiki Log Entry

wiki.logAppend

Logs wiki-meaningful actions by appending a formatted entry to wiki/log.md, supporting operation types, body, and references.

Instructions

Append one typed entry to wiki/log.md in the canonical format ## [YYYY-MM-DD] <op> | <title>, optionally followed by a body and a Refs: list. The format is chosen so grep '^## \[' log.md | tail -20 is a valid 'recent activity' query. Use this when the agent makes a wiki-meaningful action that no other wiki.* tool already logs (e.g. a decision or note); ingest and merge log themselves. Auto-runs wiki.init if the wiki has not been scaffolded yet. Idempotent only in the trivial sense — every call appends a new entry.

Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.

Examples:

Example 1 — Log an architectural decision with two refs.:

{
  "op": "decision",
  "title": "Adopt gRPC for internal RPC",
  "body": "Streaming + typed schemas outweigh the browser-edge tax.",
  "refs": [
    "wiki/Sources/adr-004.md",
    "wiki/Concepts/grpc.md"
  ]
}

Example 2 — Quick freeform note dated today.:

{
  "op": "note",
  "title": "Reviewed orphan pages from last sprint"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesLog entry kind: ingest | query | lint | note | decision | merge. Becomes the `<op>` token in `## [YYYY-MM-DD] <op> | <title>`.
titleYesOne-line title for the entry. Becomes the `<title>` token in the heading.
bodyNoOptional markdown body written under the heading. Omit for a heading-only entry.
refsNoOptional list of vault-relative paths or wiki-link targets rendered as a `Refs:` list under the entry.
dateNoYYYY-MM-DD override for the entry date. Defaults to today.
wikiRootNoPer-call wiki directory override.
vaultPathNoPer-call vault override.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
changedYesTrue if the tool altered vault state on this call; false if it was a no-op.
targetYesThe path or identifier the tool acted on.
summaryYesShort human-readable summary of what happened.

Implementation Reference

  • Core handler function that appends a log entry to the wiki log file. It resolves wiki paths, auto-runs wiki.init if log.md doesn't exist, formats the entry using formatLogEntry, reads the existing log, and appends the new entry. Returns a mutation result with changed flag, target path, summary, date, op, and entryTitle.
    export async function appendLogEntry(context: DomainContext, args: WikiLogAppendArgs) {
      const paths = resolveWikiPaths(context, args);
      if (!(await fileExists(paths.logAbsolute))) {
        await initWiki(context, { wikiRoot: args.wikiRoot, vaultPath: args.vaultPath });
      }
    
      const date = args.date ?? todayIso();
      const block = formatLogEntry({
        date,
        op: args.op,
        title: args.title,
        body: args.body,
        refs: args.refs,
      });
    
      const previous = await readUtf8(paths.logAbsolute);
      const separator = previous.endsWith("\n\n") ? "" : previous.endsWith("\n") ? "\n" : "\n\n";
      await writeUtf8(paths.logAbsolute, `${previous}${separator}${block}`);
    
      return {
        changed: true,
        target: paths.logRelative,
        summary: `Appended ${args.op} entry to ${paths.logRelative}`,
        date,
        op: args.op,
        entryTitle: args.title,
      };
    }
  • Helper function that formats a single log entry as markdown: '## [YYYY-MM-DD] <op> | <title>', followed by optional body and refs wikilink list.
    export function formatLogEntry(args: {
      date: string;
      op: string;
      title: string;
      body?: string;
      refs?: string[];
    }): string {
      const header = `## [${args.date}] ${args.op} | ${args.title}`;
      const lines: string[] = [header];
      if (args.body && args.body.trim().length > 0) {
        lines.push("", args.body.trim());
      }
      if (args.refs && args.refs.length > 0) {
        lines.push("", ...args.refs.map((ref) => `- [[${ref}]]`));
      }
      return `${lines.join("\n")}\n`;
  • Zod schema for wiki.logAppend input args: op (enum: ingest|query|lint|note|decision|merge), title (required), body (optional), refs (optional string array), date (optional YYYY-MM-DD), wikiRoot (optional), vaultPath (optional).
    export const wikiLogAppendArgsSchema = z.object({
      op: logOpSchema.describe(
        "Log entry kind: ingest | query | lint | note | decision | merge. Becomes the `<op>` token in `## [YYYY-MM-DD] <op> | <title>`.",
      ),
      title: z
        .string()
        .min(1)
        .describe("One-line title for the entry. Becomes the `<title>` token in the heading."),
      body: z
        .string()
        .optional()
        .describe("Optional markdown body written under the heading. Omit for a heading-only entry."),
      refs: z
        .array(z.string().min(1))
        .default([])
        .describe(
          "Optional list of vault-relative paths or wiki-link targets rendered as a `Refs:` list under the entry.",
        ),
      date: dateStringSchema
        .optional()
        .describe("YYYY-MM-DD override for the entry date. Defaults to today."),
      wikiRoot: wikiRootOverrideSchema.describe("Per-call wiki directory override."),
      vaultPath: z.string().optional().describe("Per-call vault override."),
    });
  • Tool registration for wiki.logAppend. Defines name 'wiki.logAppend', title 'Append Wiki Log Entry', description, inputSchema referencing wikiLogAppendArgsSchema, outputSchema (mutationResultSchema), input examples, and a handler that delegates to appendLogEntry.
    {
      name: "wiki.logAppend",
      title: "Append Wiki Log Entry",
      description:
        "Append one typed entry to `wiki/log.md` in the canonical format `## [YYYY-MM-DD] <op> | <title>`, optionally followed by a body and a `Refs:` list. The format is chosen so `grep '^## \\[' log.md | tail -20` is a valid 'recent activity' query. Use this when the agent makes a wiki-meaningful action that no other `wiki.*` tool already logs (e.g. a `decision` or `note`); `ingest` and `merge` log themselves. Auto-runs `wiki.init` if the wiki has not been scaffolded yet. Idempotent only in the trivial sense — every call appends a new entry.",
      inputSchema: wikiLogAppendArgsSchema,
      outputSchema: mutationResultSchema,
      inputExamples: [
        {
          description: "Log an architectural decision with two refs.",
          input: {
            op: "decision",
            title: "Adopt gRPC for internal RPC",
            body: "Streaming + typed schemas outweigh the browser-edge tax.",
            refs: ["wiki/Sources/adr-004.md", "wiki/Concepts/grpc.md"],
          },
        },
        {
          description: "Quick freeform note dated today.",
          input: { op: "note", title: "Reviewed orphan pages from last sprint" },
        },
      ],
      handler: (context, args) =>
        appendLogEntry(context, args as Parameters<typeof appendLogEntry>[1]),
    },
  • Re-exports appendLogEntry from ./log.js so it can be imported from the domain/wiki barrel.
    export { appendLogEntry } from "./log.js";
Behavior4/5

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

While no annotations are provided, the description discloses important behavioral traits such as idempotency (only trivial, every call appends), auto-initialization, and vault selection logic. It could be more explicit about error handling or side effects, but overall it is transparent.

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 moderately long but well-structured with a clear purpose, usage guidelines, and two practical examples. Each part serves a purpose, though it could be slightly more concise without losing value.

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

Completeness5/5

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

Given the complexity (7 parameters, no annotations), the description covers purpose, usage context, behavioral traits, and includes examples. The existence of an output schema also lessens the need to describe return values. It is complete for an agent to decide when and how to use the 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?

The input schema already has 100% description coverage, so the schema itself documents each parameter well. The description adds examples and context (e.g., op enum values, format of title, refs list) but does not provide significantly new meaning beyond what the schema already offers.

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

Purpose5/5

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

The description clearly states the action ('append one typed entry to wiki/log.md'), specifies the canonical format, and distinguishes the tool from siblings by noting that 'ingest' and 'merge' log themselves, so this tool is for other wiki-meaningful actions.

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

Usage Guidelines5/5

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

The description explicitly states when to use (when no other wiki.* tool logs the action) and when not to use (ingest and merge handle their own logging). It also mentions that the tool auto-runs wiki.init if needed, providing clear context.

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/bezata/kObsidian'

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