Skip to main content
Glama
dorukardahan

twitterapi-docs-mcp

list_twitterapi_endpoints

Browse or filter Twitter API endpoints by category to find available methods and paths for integration tasks.

Instructions

List all TwitterAPI.io API endpoints organized by category.

USE THIS WHEN: You need to browse available endpoints or find endpoints by category. CATEGORIES: user, tweet, community, webhook, stream, action, dm, list, trend

RETURNS: Endpoint names with HTTP method and path for each category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoOptional filter: user, tweet, community, webhook, stream, action, dm, list, trend

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNo

Implementation Reference

  • Handler function that implements the list_twitterapi_endpoints tool logic. Loads documentation data, categorizes endpoints based on keywords in their names, and generates a markdown-formatted list of endpoints grouped by category (user, tweet, etc.) or filtered by a specific category.
        case "list_twitterapi_endpoints": {
          // Validate category (optional)
          const validation = validateCategory(args.category);
          if (!validation.valid) {
            return formatToolError(validation.error);
          }
    
          const endpoints = Object.entries(data.endpoints || {});
    
          const categories = {
            user: [], tweet: [], list: [], community: [], trend: [],
            dm: [], action: [], webhook: [], stream: [], other: [],
          };
    
          for (const [name, ep] of endpoints) {
            if (name.includes("user") || name.includes("follow")) {
              categories.user.push({ name, ...ep });
            } else if (name.includes("tweet") || name.includes("search") || name.includes("article")) {
              categories.tweet.push({ name, ...ep });
            } else if (name.includes("list")) {
              categories.list.push({ name, ...ep });
            } else if (name.includes("community")) {
              categories.community.push({ name, ...ep });
            } else if (name.includes("trend")) {
              categories.trend.push({ name, ...ep });
            } else if (name.includes("dm")) {
              categories.dm.push({ name, ...ep });
            } else if (name.includes("webhook") || name.includes("rule")) {
              categories.webhook.push({ name, ...ep });
            } else if (name.includes("monitor") || name.includes("stream")) {
              categories.stream.push({ name, ...ep });
            } else if (["login", "like", "retweet", "create", "delete", "upload"].some(k => name.includes(k))) {
              categories.action.push({ name, ...ep });
            } else {
              categories.other.push({ name, ...ep });
            }
          }
    
          if (validation.value && categories[validation.value]) {
            const filtered = categories[validation.value];
            return formatToolSuccess(`## ${validation.value.toUpperCase()} Endpoints (${filtered.length})
    
    ${filtered.map((e) => `- **${e.name}**: ${e.method || "GET"} ${e.path || ""}\n  ${e.description || ""}`).join("\n\n")}`);
          }
    
          let output = `# TwitterAPI.io Endpoints (Total: ${endpoints.length})\n\n`;
          for (const [cat, eps] of Object.entries(categories)) {
            if (eps.length > 0) {
              output += `## ${cat.toUpperCase()} (${eps.length})\n`;
              output += eps.map((e) => `- **${e.name}**: ${e.method || "GET"} ${e.path || ""}`).join("\n");
              output += "\n\n";
            }
          }
          return formatToolSuccess(output);
        }
  • index.js:986-1022 (registration)
    Tool registration in the MCP server's ListToolsRequestSchema handler, including name, description, input schema (optional category filter), and output schema.
        {
          name: "list_twitterapi_endpoints",
          description: `List all TwitterAPI.io API endpoints organized by category.
    
    USE THIS WHEN: You need to browse available endpoints or find endpoints by category.
    CATEGORIES: user, tweet, community, webhook, stream, action, dm, list, trend
    
    RETURNS: Endpoint names with HTTP method and path for each category.`,
          inputSchema: {
            type: "object",
            properties: {
              category: {
                type: "string",
                description: "Optional filter: user, tweet, community, webhook, stream, action, dm, list, trend",
                enum: ["user", "tweet", "community", "webhook", "stream", "action", "dm", "list", "trend"]
              },
            },
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown list organized by category (USER, TWEET, WEBHOOK, etc.) with endpoint format: name: METHOD /path"
                    }
                  }
                }
              }
            }
          }
        },
  • Input validation helper function for the category parameter used in list_twitterapi_endpoints.
    function validateCategory(category) {
      if (!category) {
        return { valid: true, value: null }; // Optional parameter
      }
    
      const trimmed = category.trim().toLowerCase();
    
      if (!VALIDATION.CATEGORIES.includes(trimmed)) {
        return {
          valid: false,
          error: {
            type: ErrorType.INPUT_VALIDATION,
            message: `Unknown category: "${trimmed}"`,
            suggestion: `Available categories: ${VALIDATION.CATEGORIES.join(', ')}`,
            retryable: false
          }
        };
      }
    
      return { valid: true, value: trimmed };
    }
  • VALIDATION constant defining allowed categories for filtering endpoints.
    CATEGORIES: ['user', 'tweet', 'community', 'webhook', 'stream', 'action', 'dm', 'list', 'trend', 'other']
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool lists endpoints 'organized by category' and returns 'Endpoint names with HTTP method and path for each category', which adds useful behavioral context about the output structure. However, it doesn't mention potential limitations like pagination, rate limits, or error handling, leaving some gaps for a tool with no annotations.

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 front-loaded with the core purpose, followed by structured sections for usage, categories, and returns. Each sentence earns its place by providing essential information without redundancy, and the bullet-like formatting improves readability while maintaining brevity.

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 tool's low complexity (1 optional parameter), high schema coverage (100%), and the presence of an output schema (implied by 'RETURNS'), the description is complete enough. It covers purpose, usage, categories, and return format, addressing all necessary aspects without needing to explain parameters or output values in detail.

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?

The schema description coverage is 100%, so the baseline is 3. The description adds value by listing all categories upfront ('CATEGORIES: user, tweet, ...') and clarifying that the category parameter is an 'Optional filter', which enhances understanding beyond the schema's enum and description. This compensates well, though it doesn't provide additional syntax or format details.

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 verb 'List' and resource 'TwitterAPI.io API endpoints', specifying they are 'organized by category'. It distinguishes from siblings like 'get_twitterapi_endpoint' (singular) and 'search_twitterapi_docs' by focusing on browsing all endpoints by category rather than retrieving a single endpoint or searching documentation.

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

Usage Guidelines5/5

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

The 'USE THIS WHEN' section explicitly states when to use this tool: 'You need to browse available endpoints or find endpoints by category.' This provides clear context for usage and implicitly distinguishes it from siblings that handle authentication, specific endpoints, guides, pricing, or documentation search.

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/dorukardahan/twitterapi-docs-mcp'

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