Skip to main content
Glama

reject_instinct

Deactivate an instinct and reduce its confidence by providing its ID, helping manage automated context rules in persistent chat sessions.

Instructions

Reject/deactivate an instinct and lower its confidence

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInstinct ID to reject

Implementation Reference

  • The core implementation of the 'reject' logic, which deactivates an instinct and adjusts its confidence.
    /** Reject an instinct: deactivate and drop confidence. */
    async reject(id: string): Promise<Instinct> {
      const entry = await this.find(id);
      if (!entry) throw new Error(`Instinct not found: ${id}`);
    
      const { file, instinctFile, instinct } = entry;
      instinct.active = false;
      instinct.confidence = Math.max(0, instinct.confidence - 0.3);
      // Ensure min_confidence doesn't exceed new confidence (Zod invariant)
      instinct.min_confidence = Math.min(instinct.min_confidence, instinct.confidence);
      instinct.updated_at = new Date().toISOString();
    
      // Record rejection in outcome_log
      const outcome: OutcomeEntry = {
        timestamp: new Date().toISOString(),
        result: 'negative',
        delta_confidence: -0.3,
        note: 'Rejected via CLI',
      };
      instinct.outcome_log.push(outcome);
    
      instinctFile.instincts[id] = instinct;
      await this.loader.save(file, instinctFile);
    
      return instinct;
    }
  • The MCP tool handler in the server that invokes the registry's reject method.
    case 'reject_instinct': {
      const id = String(args?.['id'] ?? '');
      if (!id) return { content: [{ type: 'text', text: 'Error: id is required' }] };
      try {
        const instinct = await registry.reject(id);
        return { content: [{ type: 'text', text: JSON.stringify({ rejected: id, confidence: instinct.confidence, active: instinct.active }, null, 2) }] };
      } catch (e) {
        return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }] };
      }
    }
  • Registration of the 'reject_instinct' tool in the MCP server list.
      name: 'reject_instinct',
      description: 'Reject/deactivate an instinct and lower its confidence',
      inputSchema: {
        type: 'object' as const,
        properties: {
          id: { type: 'string', description: 'Instinct ID to reject' },
        },
        required: ['id'],
      },
    },

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/doobidoo/MCP-Context-Provider'

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