Skip to main content
Glama
MikeyBeez

MCP Contemplation

by MikeyBeez

get_insights

Retrieve processed cognitive insights from Claude's contemplation loop, filtered by thought type, significance, and quantity for analysis.

Instructions

Retrieve processed insights from contemplation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thought_typeNoFilter by thought type
limitNoMaximum insights to return (default 10)
min_significanceNoMinimum significance score 1-10 (default 5)

Implementation Reference

  • Core handler function implementing the get_insights tool logic: prunes, aggregates, filters, sorts insights by significance and recency, marks as used, and returns top results.
    async getInsights(thoughtType?: string, limit: number = 10): Promise<Insight[]> {
      // First, clean up old/low-value insights
      this.pruneInsights();
      
      // Aggregate similar insights
      this.aggregateSimilarInsights();
      
      // Filter unused insights above threshold
      let filtered = this.insights.filter(i => 
        !i.used && i.significance >= this.significanceThreshold
      );
      
      if (thoughtType) {
        filtered = filtered.filter(i => i.thought_type === thoughtType);
      }
      
      // Sort by significance and recency
      filtered.sort((a, b) => {
        // Prioritize aggregated insights
        if (a.similar_count && b.similar_count) {
          const countDiff = (b.similar_count || 1) - (a.similar_count || 1);
          if (countDiff !== 0) return countDiff;
        }
        
        if (b.significance !== a.significance) {
          return b.significance - a.significance;
        }
        return new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime();
      });
    
      // Mark as used and clean from memory
      const results = filtered.slice(0, limit);
      results.forEach(insight => {
        insight.used = true;
        // Remove high-frequency patterns after use to prevent repetition
        if (insight.similar_count && insight.similar_count > 3) {
          this.removeInsight(insight.id);
        }
      });
    
      return results;
    }
  • Input schema for the get_insights tool, defining parameters thought_type, limit, and min_significance with validation.
    inputSchema: {
      type: 'object',
      properties: {
        thought_type: {
          type: 'string',
          enum: ['pattern', 'connection', 'question', 'general'],
          description: 'Filter by thought type'
        },
        limit: {
          type: 'number',
          description: 'Maximum insights to return (default 10)'
        },
        min_significance: {
          type: 'number',
          description: 'Minimum significance score 1-10 (default 5)',
          minimum: 1,
          maximum: 10
        }
      },
    },
  • src/index.ts:409-432 (registration)
    Registration of the get_insights tool in the ListTools response, including name, description, and input schema.
    {
      name: 'get_insights',
      description: 'Retrieve processed insights from contemplation',
      inputSchema: {
        type: 'object',
        properties: {
          thought_type: {
            type: 'string',
            enum: ['pattern', 'connection', 'question', 'general'],
            description: 'Filter by thought type'
          },
          limit: {
            type: 'number',
            description: 'Maximum insights to return (default 10)'
          },
          min_significance: {
            type: 'number',
            description: 'Minimum significance score 1-10 (default 5)',
            minimum: 1,
            maximum: 10
          }
        },
      },
    },
  • src/index.ts:518-533 (registration)
    Dispatch handler in CallToolRequest that processes get_insights calls, sets threshold if provided, invokes the handler, and formats response.
    case 'get_insights': {
      const { thought_type, limit, min_significance } = args as {
        thought_type?: string;
        limit?: number;
        min_significance?: number;
      };
      
      if (min_significance) {
        contemplation.setThreshold(min_significance);
      }
      
      const insights = await contemplation.getInsights(thought_type, limit);
      return {
        content: [{ type: 'text', text: JSON.stringify(insights, null, 2) }],
      };
    }
  • Type schema for Insight objects, which are the output structure of the get_insights tool.
    interface Insight {
      id: string;
      thought_type: string;
      content: string;
      significance: number;
      timestamp: string;
      used: boolean;
      similar_count?: number;
      aggregated_ids?: string[];
    }
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 but offers minimal information. It mentions 'processed insights' but doesn't clarify what processing entails, whether this is a read-only operation, potential rate limits, authentication needs, or the format of returned data. This leaves significant gaps in understanding the tool's behavior beyond basic retrieval.

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 extremely concise with a single, direct sentence that states the core purpose without unnecessary words. It's front-loaded with the essential action and resource, making it efficient and easy to parse, though this brevity contributes to gaps in other dimensions.

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 the complexity of retrieving 'insights' with three parameters and no output schema or annotations, the description is incomplete. It doesn't explain what 'insights' are, how they're structured, or what 'contemplation' refers to, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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 has 100% description coverage, clearly documenting all three parameters with enums, defaults, and constraints. The description adds no additional parameter semantics beyond what the schema provides, such as explaining the significance of 'thought_type' values or how 'min_significance' affects results. This meets the baseline for adequate schema coverage but doesn't enhance understanding.

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 verb 'Retrieve' and the resource 'processed insights from contemplation', making the purpose understandable. However, it doesn't differentiate this tool from potential sibling tools like 'get_memory_stats' or 'get_status' that might also retrieve information, leaving room for ambiguity about when to choose this specific retrieval tool.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_memory_stats' and 'get_status' that might retrieve different types of data, the description fails to specify the context or scenarios where 'get_insights' is appropriate, offering no exclusion criteria or comparative information.

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/MikeyBeez/mcp-contemplation'

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