Skip to main content
Glama
vuluu2k
by vuluu2k

addKnowledge

Store and organize information by adding entries to topics. Creates topics automatically when needed for facts, how-tos, decisions, or other valuable knowledge.

Instructions

Add a new knowledge entry to a topic. Creates the topic if it doesn't exist. Use this to store facts, how-tos, decisions, or anything worth remembering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesTopic name (e.g. typescript, docker, recipes)
titleYesEntry title / question
contentYesEntry content / answer / explanation

Implementation Reference

  • The core implementation of the addKnowledge logic within the KnowledgeBase class.
    async addKnowledge(
      topic: string,
      title: string,
      content: string
    ): Promise<{ success: true }> {
      const log = getLogger();
      const path = this.topicPath(topic);
    
      try {
        await this.atomicUpdate(
          path,
          (current) => appendEntry(current, title, content),
          `feat(ai): add knowledge to ${topic}`
        );
      } catch (err) {
        if (isNotFound(err)) {
          const displayName = topic.charAt(0).toUpperCase() + topic.slice(1);
          const initial = `# ${displayName}\n\n## ${title}\n\n${content}\n`;
          await this.client.createFile(
            path,
            initial,
            `feat(ai): create knowledge topic ${topic}`
          );
        } else throw err;
      }
    
      log.info("addKnowledge", { topic, title });
      return { success: true };
    }
  • Registration of the addKnowledge tool, which maps the tool request to the KnowledgeBase.addKnowledge method.
    server.registerTool(
      "addKnowledge",
      {
        description:
          "Add a new knowledge entry to a topic. Creates the topic if it doesn't exist. Use this to store facts, how-tos, decisions, or anything worth remembering.",
        inputSchema: {
          topic: z.string().describe("Topic name (e.g. typescript, docker, recipes)"),
          title: z.string().describe("Entry title / question"),
          content: z.string().describe("Entry content / answer / explanation"),
        },
      },
      toolHandler("addKnowledge", async ({ topic, title, content }) =>
        kb.addKnowledge(topic, title, content)
      )
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: 'Creates the topic if it doesn't exist' reveals side effects beyond the primary add operation. However, it doesn't cover permissions, error conditions, or response format, leaving gaps 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.

Conciseness5/5

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

The description is concise and front-loaded: two sentences with zero waste. The first sentence states the core purpose and side effect, the second provides usage context. Every sentence earns its place without redundancy.

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

Completeness3/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 and no output schema, the description is adequate but incomplete. It covers the primary action and a key side effect, but lacks details on permissions, error handling, or return values. Given the complexity and lack of structured data, it should do more to be fully helpful.

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 100%, so the schema already documents all three parameters. The description adds minimal value beyond the schema: it implies 'topic' is for categorization and 'content' stores information, but doesn't provide additional syntax, format, or constraints. Baseline 3 is appropriate when schema does the heavy lifting.

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: 'Add a new knowledge entry to a topic' with the specific action 'add' and resource 'knowledge entry'. It distinguishes from siblings like 'addNote' or 'addTask' by specifying knowledge entries, but doesn't explicitly contrast with 'searchKnowledge' or 'getKnowledge'.

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

Usage Guidelines3/5

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

The description provides implied usage guidance: 'Use this to store facts, how-tos, decisions, or anything worth remembering.' This suggests appropriate contexts but doesn't explicitly state when to use this versus alternatives like 'addNote' or 'saveToInbox', nor does it mention prerequisites or exclusions.

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/vuluu2k/knowledge_mcp'

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