Skip to main content
Glama
manimohans

Farcaster MCP Server

by manimohans

get-user-casts

Retrieve casts from a specific Farcaster user by providing their FID, with options to limit the number of results returned.

Instructions

Get casts from a specific Farcaster user by FID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fidYesFarcaster user ID (FID)
limitNoMaximum number of casts to return (default: 10)

Implementation Reference

  • The async handler function that implements the core logic of the 'get-user-casts' tool: fetches casts for a given FID from the Hubble API, formats them using formatCasts helper, and returns formatted text response or error.
    async ({ fid, limit = 10 }: { fid: number; limit?: number }) => {
      try {
        console.error(`Fetching casts for FID ${fid} with limit ${limit}`);
        const response = await fetchFromHubble(`/castsByFid`, {
          fid,
          pageSize: limit,
          reverse: 1 // Get newest first
        }) as FarcasterCastsResponse;
        
        console.error(`Got response with ${response.messages?.length || 0} messages`);
        
        if (!response.messages || response.messages.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: `No casts found for FID ${fid}`
              }
            ]
          };
        }
        
        const castsText = await formatCasts(response.messages, limit);
        
        return {
          content: [
            {
              type: "text",
              text: `# Casts from FID ${fid}\n\n${castsText}`
            }
          ]
        };
      } catch (error) {
        console.error("Error in get-user-casts:", error);
        return {
          content: [
            {
              type: "text",
              text: `Error fetching casts: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining input parameters for the 'get-user-casts' tool: required fid (number) and optional limit (number).
    {
      fid: z.number().describe("Farcaster user ID (FID)"),
      limit: z.number().optional().describe("Maximum number of casts to return (default: 10)")
    },
  • src/index.ts:414-466 (registration)
    Registration of the 'get-user-casts' tool with MCP server using server.tool(name, description, inputSchema, handler).
    server.tool(
      "get-user-casts",
      "Get casts from a specific Farcaster user by FID",
      {
        fid: z.number().describe("Farcaster user ID (FID)"),
        limit: z.number().optional().describe("Maximum number of casts to return (default: 10)")
      },
      async ({ fid, limit = 10 }: { fid: number; limit?: number }) => {
        try {
          console.error(`Fetching casts for FID ${fid} with limit ${limit}`);
          const response = await fetchFromHubble(`/castsByFid`, {
            fid,
            pageSize: limit,
            reverse: 1 // Get newest first
          }) as FarcasterCastsResponse;
          
          console.error(`Got response with ${response.messages?.length || 0} messages`);
          
          if (!response.messages || response.messages.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: `No casts found for FID ${fid}`
                }
              ]
            };
          }
          
          const castsText = await formatCasts(response.messages, limit);
          
          return {
            content: [
              {
                type: "text",
                text: `# Casts from FID ${fid}\n\n${castsText}`
              }
            ]
          };
        } catch (error) {
          console.error("Error in get-user-casts:", error);
          return {
            content: [
              {
                type: "text",
                text: `Error fetching casts: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions, rate limits, error handling, or return format. For a read operation with no annotations, this leaves significant gaps in understanding how the tool behaves.

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 a single, clear sentence with zero waste. It is front-loaded with the core purpose and efficiently conveys the essential information without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate but incomplete. It lacks details on behavioral aspects like pagination, error cases, or output structure, which are important for a read operation without annotations to guide the agent.

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?

Schema description coverage is 100%, so the schema already documents both parameters (fid and limit) adequately. The description adds no additional meaning beyond what the schema provides, such as parameter interactions or usage examples, which aligns with the baseline score when schema coverage is high.

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 action ('Get casts') and specifies the resource ('from a specific Farcaster user by FID'), making the purpose explicit. It distinguishes from sibling tools like 'get-channel-casts' and 'get-username-casts' by focusing on user ID rather than channel or username.

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 like 'get-username-casts' or 'get-channel-casts'. It does not mention prerequisites, exclusions, or contextual factors that would help an agent choose between these sibling 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/manimohans/farcaster-mcp'

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