Skip to main content
Glama

knowledge_upvote

Increase memory entry importance to surface critical insights in behavioral warnings through graduation.

Instructions

Upvote a memory entry to increase its importance (graduation). Entries with importance >= 7 become 'graduated' insights that always surface in behavioral warnings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe UUID of the ledger entry to upvote.

Implementation Reference

  • Handler for the 'knowledge_upvote' tool which increases the importance score of a memory entry.
    export async function knowledgeUpvoteHandler(args: unknown) {
      if (!isKnowledgeVoteArgs(args)) {
        throw new Error("Invalid arguments for knowledge_upvote");
      }
    
      const storage = await getStorage();
      try {
        await storage.adjustImportance(args.id, 1, PRISM_USER_ID);
        debugLog(`[knowledge_upvote] Upvoted entry ${args.id}`);
        return {
          content: [{ type: "text", text: `👍 Entry ${args.id} upvoted (+1 importance).` }],
          isError: false,
        };
      } catch (err) {
        const msg = err instanceof Error ? err.message : String(err);
        return {
          content: [{ type: "text", text: `❌ Failed to upvote entry ${args.id}: ${msg}` }],
          isError: true,
        };
      }
    }
  • Definition/schema for the 'knowledge_upvote' tool.
    export const KNOWLEDGE_UPVOTE_TOOL: Tool = {
      name: "knowledge_upvote",
      description:
        "Upvote a memory entry to increase its importance (graduation). " +
        "Entries with importance >= 7 become 'graduated' insights that always " +
        "surface in behavioral warnings.",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "The UUID of the ledger entry to upvote.",
          },
        },
        required: ["id"],
      },
    };
  • src/server.ts:133-133 (registration)
    Tool registration for KNOWLEDGE_UPVOTE_TOOL in server.ts.
    KNOWLEDGE_UPVOTE_TOOL,

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/dcostenco/BCBA'

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