Skip to main content
Glama

get_idea

Retrieve detailed information about an idea by its ID, including current support and pass counts to see what other players think.

Instructions

Fetch full detail on one idea by id, including current support / pass counts (so the agent can see what other players think).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe idea id (uuid).

Implementation Reference

  • The async handler for the 'get_idea' tool. Fetches full idea details (title, description, category, media, deadlines, resolution criteria, verification info, result) from the 'ideas' table and support/pass counts from the 'idea_support_counts' view, then returns them as JSON.
    async ({ id }) => {
      const [ideaRes, countsRes] = await Promise.all([
        sb
          .from('ideas')
          .select(
            'id,title,one_liner,description,category,media_url,' +
            'lock_at,resolve_at,resolution_criteria,verification_source_type,' +
            'verification_ref,result',
          )
          .eq('id', id)
          .eq('status', 'approved')
          .maybeSingle(),
        sb
          .from('idea_support_counts')
          .select('support_count,pass_count')
          .eq('idea_id', id)
          .maybeSingle(),
      ]);
    
      if (ideaRes.error) {
        return {
          content: [{ type: 'text', text: `error: ${ideaRes.error.message}` }],
          isError: true,
        };
      }
      if (!ideaRes.data) {
        return {
          content: [{ type: 'text', text: `not found or not approved: ${id}` }],
          isError: true,
        };
      }
      // Supabase's inferred row types are noisy without a generated schema;
      // cast through unknown to a local shape to keep the rest of the code clean.
      const idea = ideaRes.data as unknown as {
        id: string; title: string; one_liner: string; description: string;
        category: string; media_url: string; lock_at: string; resolve_at: string;
        resolution_criteria: string | null; verification_source_type: string | null;
        verification_ref: unknown; result: 'success' | 'fail' | null;
      };
      const counts = countsRes.data as unknown as
        | { support_count: number; pass_count: number }
        | null;
    
      const payload = {
        id: idea.id,
        title: idea.title,
        oneLiner: idea.one_liner,
        description: idea.description,
        category: idea.category,
        mediaUrl: idea.media_url,
        lockAt: idea.lock_at,
        resolveAt: idea.resolve_at,
        resolutionCriteria: idea.resolution_criteria,
        verificationSourceType: idea.verification_source_type,
        verificationRef: idea.verification_ref,
        result: idea.result,
        supportCount: counts?.support_count ?? 0,
        passCount: counts?.pass_count ?? 0,
      };
      return {
        content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
      };
    },
  • Input schema for 'get_idea' — requires a single 'id' parameter of type UUID string.
    inputSchema: {
      id: z.string().uuid().describe('The idea id (uuid).'),
    },
  • src/index.ts:117-190 (registration)
    Registration of the 'get_idea' tool on the MCP server via server.registerTool() with its description, input schema, and handler.
    server.registerTool(
      'get_idea',
      {
        description:
          'Fetch full detail on one idea by id, including current support / ' +
          'pass counts (so the agent can see what other players think).',
        inputSchema: {
          id: z.string().uuid().describe('The idea id (uuid).'),
        },
      },
      async ({ id }) => {
        const [ideaRes, countsRes] = await Promise.all([
          sb
            .from('ideas')
            .select(
              'id,title,one_liner,description,category,media_url,' +
              'lock_at,resolve_at,resolution_criteria,verification_source_type,' +
              'verification_ref,result',
            )
            .eq('id', id)
            .eq('status', 'approved')
            .maybeSingle(),
          sb
            .from('idea_support_counts')
            .select('support_count,pass_count')
            .eq('idea_id', id)
            .maybeSingle(),
        ]);
    
        if (ideaRes.error) {
          return {
            content: [{ type: 'text', text: `error: ${ideaRes.error.message}` }],
            isError: true,
          };
        }
        if (!ideaRes.data) {
          return {
            content: [{ type: 'text', text: `not found or not approved: ${id}` }],
            isError: true,
          };
        }
        // Supabase's inferred row types are noisy without a generated schema;
        // cast through unknown to a local shape to keep the rest of the code clean.
        const idea = ideaRes.data as unknown as {
          id: string; title: string; one_liner: string; description: string;
          category: string; media_url: string; lock_at: string; resolve_at: string;
          resolution_criteria: string | null; verification_source_type: string | null;
          verification_ref: unknown; result: 'success' | 'fail' | null;
        };
        const counts = countsRes.data as unknown as
          | { support_count: number; pass_count: number }
          | null;
    
        const payload = {
          id: idea.id,
          title: idea.title,
          oneLiner: idea.one_liner,
          description: idea.description,
          category: idea.category,
          mediaUrl: idea.media_url,
          lockAt: idea.lock_at,
          resolveAt: idea.resolve_at,
          resolutionCriteria: idea.resolution_criteria,
          verificationSourceType: idea.verification_source_type,
          verificationRef: idea.verification_ref,
          result: idea.result,
          supportCount: counts?.support_count ?? 0,
          passCount: counts?.pass_count ?? 0,
        };
        return {
          content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
        };
      },
    );
Behavior4/5

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

No annotations provided, but description indicates a read operation returning detail and counts. It does not disclose potential errors or limitations, but is straightforward for a fetch.

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?

Single sentence, front-loaded with verb and resource, no unnecessary words. Highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 1-param read tool with no output schema, the description is adequate. It explains what is returned. Missing details on error handling but acceptable given simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with id description. The description adds value by mentioning the returned data includes support/pass counts, providing context beyond the parameter.

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 fetches full detail on one idea by id, and specifies what is included (support/pass counts). It distinguishes from siblings like list_open_ideas, which likely lists multiple ideas.

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

Usage Guidelines3/5

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

Usage is implied: use when needing full detail on a specific idea. No explicit when-to-use or alternatives mentioned, but the sibling set is small and purpose is clear.

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/Chesterguan/calledit-mcp'

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