Skip to main content
Glama

Graph Boost

graph_boost
Idempotent

Increase edge weight to reinforce confirmed relationships in your knowledge graph. Call when user confirms retrieved information.

Instructions

Increase an edge's weight when the user confirms recalled information. Call this when the user says 'yes', 'exactly', or confirms something you retrieved from the graph. Persists immediately; weight clamps at 1.0 so repeated boosts saturate rather than overflow. Returns the previous and new weight.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_nameYesSource entity name or ID
to_nameYesTarget entity name or ID
relationYesRelationship type (e.g. WORKS_ON, PREFERS)
amountNoBoost amount (default: 0.15)
reasonNoWhy boosting

Implementation Reference

  • Registers the graph_boost MCP tool in the server. Defines input schema (from_name, to_name, relation, amount, reason) and calls client.boost() with resolved entity IDs.
    server.registerTool("graph_boost", {
      title: "Graph Boost",
      description:
        "Increase an edge's weight when the user confirms recalled information. Call this when the user says 'yes', 'exactly', or confirms something you retrieved from the graph. Persists immediately; weight clamps at 1.0 so repeated boosts saturate rather than overflow. Returns the previous and new weight.",
      inputSchema: {
        from_name: z.string().describe("Source entity name or ID"),
        to_name: z.string().describe("Target entity name or ID"),
        relation: z.string().describe("Relationship type (e.g. WORKS_ON, PREFERS)"),
        amount: z.number().optional().default(0.15).describe("Boost amount (default: 0.15)"),
        reason: z.string().optional().describe("Why boosting"),
      },
      annotations: { idempotentHint: true },
    }, async (args) => {
      try {
        const tenantId = currentTenant();
        const fromId = (await client.findEntityIdByName(tenantId, args.from_name)) ?? slugify(args.from_name);
        const toId = (await client.findEntityIdByName(tenantId, args.to_name)) ?? slugify(args.to_name);
        const result = await client.boost(tenantId, fromId, toId, args.relation as RelationshipType, args.amount);
        return toolResult({
          previous_weight: result.previous_weight,
          new_weight: result.new_weight,
          edge: { from: fromId, to: toId, type: args.relation },
        });
      } catch (err) {
        return toolError(`graph_boost failed: ${err instanceof Error ? err.message : String(err)}`);
      }
    });
  • Handler for graph_boost. Resolves entity names to IDs (via findEntityIdByName or slugify fallback), then delegates to client.boost() to increase edge weight.
    }, async (args) => {
      try {
        const tenantId = currentTenant();
        const fromId = (await client.findEntityIdByName(tenantId, args.from_name)) ?? slugify(args.from_name);
        const toId = (await client.findEntityIdByName(tenantId, args.to_name)) ?? slugify(args.to_name);
        const result = await client.boost(tenantId, fromId, toId, args.relation as RelationshipType, args.amount);
        return toolResult({
          previous_weight: result.previous_weight,
          new_weight: result.new_weight,
          edge: { from: fromId, to: toId, type: args.relation },
        });
      } catch (err) {
        return toolError(`graph_boost failed: ${err instanceof Error ? err.message : String(err)}`);
      }
    });
  • Input schema for graph_boost tool: from_name (string), to_name (string), relation (string), amount (number, default 0.15), reason (optional string).
    inputSchema: {
      from_name: z.string().describe("Source entity name or ID"),
      to_name: z.string().describe("Target entity name or ID"),
      relation: z.string().describe("Relationship type (e.g. WORKS_ON, PREFERS)"),
      amount: z.number().optional().default(0.15).describe("Boost amount (default: 0.15)"),
      reason: z.string().optional().describe("Why boosting"),
    },
    annotations: { idempotentHint: true },
  • Core boost logic in Neo4jClient. Executes a Cypher MATCH on the edge, increments weight clamped at 1.0, updates last_confirmed, and returns previous/new weights. Falls back to config.weights.boost_on_confirm (0.15) if no amount provided.
    async boost(
      tenantId: string,
      fromId: string,
      toId: string,
      type: RelationshipType,
      amount?: number,
    ): Promise<{ previous_weight: number; new_weight: number }> {
      const config = getConfig();
      const boostAmount = amount ?? config.weights.boost_on_confirm;
      const rows = await this.run(
        `
        MATCH (a:Entity {tenant_id: $tenantId, id: $fromId})-[r:\`${type}\`]->(b:Entity {tenant_id: $tenantId, id: $toId})
        WITH r, r.weight AS old_weight
        SET r.weight = CASE WHEN r.weight + $amount > 1.0 THEN 1.0 ELSE r.weight + $amount END,
            r.last_confirmed = datetime()
        RETURN old_weight, r.weight AS new_weight
        `,
        { tenantId, fromId, toId, amount: boostAmount },
      );
      const row = rows[0];
      if (!row) throw new Error(`Edge not found: ${fromId} -[${type}]-> ${toId} in tenant ${tenantId}`);
      return {
        previous_weight: Number(row["old_weight"]),
        new_weight: Number(row["new_weight"]),
      };
    }
Behavior5/5

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

Beyond the idempotentHint annotation, the description discloses key behaviors: 'Persists immediately; weight clamps at 1.0 so repeated boosts saturate rather than overflow' and 'Returns the previous and new weight.' These details about persistence, saturation, and output are valuable for correct invocation.

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 with three sentences: purpose, when to use, and behavior with returns. Every sentence adds value without wasted words.

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 (5 parameters, no output schema), the description covers purpose, usage context, persistence behavior, saturation, and return values. It is complete enough for an AI agent to correctly invoke 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% coverage with descriptions for each parameter. The description does not add significant meaning beyond explaining the overall process, so baseline score of 3 is appropriate.

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 tool's purpose: 'Increase an edge's weight when the user confirms recalled information.' It specifies the verb (increase), resource (edge weight), and context (user confirmation), distinguishing it from sibling tools like graph_decay or graph_weaken.

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

Usage Guidelines4/5

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

Explicitly states when to use: 'Call this when the user says 'yes', 'exactly', or confirms something you retrieved from the graph.' This provides clear trigger conditions, though it does not explicitly exclude other contexts or mention alternative tools.

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/stevepridemore/graph-memory'

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