Skip to main content
Glama

kb_add_custom

Add custom knowledge entries to structured categories for persistent storage and retrieval in the MCP Instruct server's knowledge base.

Instructions

Add custom knowledge to any category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory name (e.g., "tools", "workflows", "contacts")
keyYesKnowledge key/identifier
valueYesKnowledge value (can be string, object, array, etc.)
tagsNoOptional tags for categorization

Implementation Reference

  • src/index.ts:153-178 (registration)
    Registration of the 'kb_add_custom' tool including name, description, and input schema for listing tools.
    {
      name: 'kb_add_custom',
      description: 'Add custom knowledge to any category',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Category name (e.g., "tools", "workflows", "contacts")'
          },
          key: {
            type: 'string',
            description: 'Knowledge key/identifier'
          },
          value: {
            description: 'Knowledge value (can be string, object, array, etc.)'
          },
          tags: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional tags for categorization'
          }
        },
        required: ['category', 'key', 'value']
      }
    },
  • Tool handler that parses arguments, calls KnowledgeManager.addCustomKnowledge, and returns success message.
    case 'kb_add_custom': {
      const { category, key, value, tags } = args as any;
      await km.addCustomKnowledge(category, key, value, tags);
      return {
        content: [
          {
            type: 'text',
            text: `✅ Added custom knowledge: ${category}/${key}`
          }
        ]
      };
    }
  • Core helper method in KnowledgeManager that implements adding or updating custom knowledge, manages history, and persists to file.
    async addCustomKnowledge(category: string, key: string, value: any, tags?: string[]): Promise<void> {
      const existing = this.kb.custom.findIndex(k => k.category === category && k.key === key);
      
      const customKnowledge: CustomKnowledge = {
        category,
        key,
        value,
        metadata: {
          addedAt: new Date().toISOString(),
          lastUpdated: new Date().toISOString(),
          tags
        }
      };
    
      if (existing >= 0) {
        const oldValue = this.kb.custom[existing].value;
        this.kb.custom[existing] = customKnowledge;
        this.addHistory({
          action: 'update',
          category: `custom:${category}`,
          field: key,
          oldValue,
          newValue: value
        });
      } else {
        this.kb.custom.push(customKnowledge);
        this.addHistory({
          action: 'add',
          category: `custom:${category}`,
          field: key,
          newValue: value
        });
      }
    
      await this.save();
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Add custom knowledge' which implies a write/mutation operation, but doesn't disclose permissions needed, whether it overwrites existing entries, rate limits, or response format. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

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 front-loaded with the core purpose and appropriately sized for a straightforward tool, making it easy for an agent to parse quickly.

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 this is a mutation tool (implied by 'Add') with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success/failure, whether the operation is idempotent, or how conflicts with existing entries are handled. For a tool that modifies persistent data, more behavioral context is needed.

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 all parameters are documented in the schema. The description doesn't add any parameter-specific semantics beyond implying 'category' is flexible ('any category') and 'value' can be complex. Since the schema already covers parameter purposes thoroughly, the baseline score of 3 is appropriate.

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 'Add custom knowledge to any category' clearly states the action (add) and resource (custom knowledge) with scope (any category). It distinguishes from siblings like kb_remove_custom (remove) and kb_get_custom (retrieve), though it doesn't explicitly contrast with kb_update_* tools which might overlap.

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?

No guidance is provided on when to use this tool versus alternatives like kb_update_personal or kb_import. The description implies it's for adding new custom knowledge, but it doesn't specify prerequisites, constraints, or when-not-to-use scenarios, leaving the agent to infer usage from context 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/hlsitechio/mcp-instruct'

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