Skip to main content
Glama
dorukardahan

twitterapi-docs-mcp

get_twitterapi_auth

Set up authentication for TwitterAPI.io by learning API key usage, required headers, and viewing code examples in cURL, Python, and JavaScript.

Instructions

Get TwitterAPI.io authentication guide: API key usage, headers, code examples.

USE THIS WHEN: You need to set up authentication or see request examples. RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNo

Implementation Reference

  • Handler implementation for the 'get_twitterapi_auth' tool. Loads authentication data from the docs JSON and returns a formatted Markdown response with API key usage instructions, base URL, and code examples in cURL, Python, and JavaScript.
        case "get_twitterapi_auth": {
          const auth = data.authentication || {};
    
          return formatToolSuccess(`# TwitterAPI.io Authentication
    
    ## API Key Usage
    All requests require the \`${auth.header || "x-api-key"}\` header.
    
    ## Base URL
    \`${auth.base_url || "https://api.twitterapi.io"}\`
    
    ## Getting Your API Key
    1. Go to ${auth.dashboard_url || "https://twitterapi.io/dashboard"}
    2. Sign up / Log in
    3. Copy your API key from the dashboard
    
    ## Request Examples
    
    ### cURL
    \`\`\`bash
    curl -X GET "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info?userName=elonmusk" \\
      -H "${auth.header || "x-api-key"}: YOUR_API_KEY"
    \`\`\`
    
    ### Python
    \`\`\`python
    import requests
    
    response = requests.get(
        "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info",
        params={"userName": "elonmusk"},
        headers={"${auth.header || "x-api-key"}": "YOUR_API_KEY"}
    )
    print(response.json())
    \`\`\`
    
    ### JavaScript
    \`\`\`javascript
    const response = await fetch(
      "${auth.base_url || "https://api.twitterapi.io"}/twitter/user/info?userName=elonmusk",
      { headers: { "${auth.header || "x-api-key"}": "YOUR_API_KEY" } }
    );
    const data = await response.json();
    \`\`\``);
        }
  • Tool schema definition including inputSchema (no parameters required) and outputSchema specifying markdown text content for the authentication guide.
          name: "get_twitterapi_auth",
          description: `Get TwitterAPI.io authentication guide: API key usage, headers, code examples.
    
    USE THIS WHEN: You need to set up authentication or see request examples.
    RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.`,
          inputSchema: {
            type: "object",
            properties: {},
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown with: API Key Usage header name, Base URL, Getting Your API Key steps, Request Examples (cURL, Python, JavaScript code blocks)"
                    }
                  }
                }
              }
            }
          }
        },
  • index.js:894-1120 (registration)
    Registration of all tools including 'get_twitterapi_auth' in the ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: "search_twitterapi_docs",
          description: `Search TwitterAPI.io documentation: API endpoints, guides (pricing, rate limits, filter rules), and blog posts.
    
    USE THIS WHEN: You need to find information across the entire documentation.
    RETURNS: Ranked results with endpoint paths, descriptions, and relevance scores.
    
    Examples:
    - "advanced search" → finds tweet search endpoints
    - "rate limit" → finds QPS limits and pricing info
    - "webhook" → finds webhook setup endpoints
    - "getUserInfo" → finds user info endpoints (supports camelCase)`,
          inputSchema: {
            type: "object",
            properties: {
              query: {
                type: "string",
                description: "Search query (1-500 chars). Use English keywords like: 'search', 'user', 'tweet', 'webhook', 'pricing', 'rate limit'. Supports camelCase and underscore formats.",
                minLength: 1,
                maxLength: 500
              },
              max_results: {
                type: "integer",
                description: "Number of results to return. Use higher values (15-20) for comprehensive research, lower values (3-5) for quick lookups.",
                minimum: 1,
                maximum: 20,
                default: 10
              }
            },
            required: ["query"],
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown formatted search results with sections: API Endpoints (name, method, path, description), Guides (name, title, url), Blog Posts (title, url)"
                    }
                  }
                }
              }
            }
          }
        },
        {
          name: "get_twitterapi_endpoint",
          description: `Get complete documentation for a specific TwitterAPI.io endpoint.
    
    USE THIS WHEN: You know the exact endpoint name (e.g., from search results).
    RETURNS: Full details including path, parameters, cURL example, and code snippets.
    
    Common endpoints:
    - get_user_info, get_user_followers, get_user_following
    - tweet_advanced_search, get_tweet_by_id
    - add_webhook_rule, get_webhook_rules`,
          inputSchema: {
            type: "object",
            properties: {
              endpoint_name: {
                type: "string",
                description: "Exact endpoint name (use underscores). Examples: 'get_user_info', 'tweet_advanced_search', 'add_webhook_rule'",
              },
            },
            required: ["endpoint_name"],
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown with: Title, Endpoint Details (method, path, full URL, doc link), Description, Parameters list (name, required, description), cURL Example, Code Examples, Full Documentation"
                    }
                  }
                }
              }
            }
          }
        },
        {
          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"
                    }
                  }
                }
              }
            }
          }
        },
        {
          name: "get_twitterapi_guide",
          description: `Get TwitterAPI.io guide pages for conceptual topics.
    
    USE THIS WHEN: You need information about pricing, rate limits, authentication, or filter rules.
    AVAILABLE GUIDES: pricing, qps_limits, tweet_filter_rules, changelog, introduction, authentication, readme
    
    RETURNS: Full guide content with headers, paragraphs, and code examples.`,
          inputSchema: {
            type: "object",
            properties: {
              guide_name: {
                type: "string",
                description: "Guide name: pricing, qps_limits, tweet_filter_rules, changelog, introduction, authentication, readme",
                enum: ["pricing", "qps_limits", "tweet_filter_rules", "changelog", "introduction", "authentication", "readme"]
              },
            },
            required: ["guide_name"],
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown with: Title, URL, Overview, Table of Contents, Content paragraphs, Key Points list, Code Examples, Full Content"
                    }
                  }
                }
              }
            }
          }
        },
        {
          name: "get_twitterapi_pricing",
          description: `Get TwitterAPI.io pricing information: credit system, endpoint costs, QPS limits.
    
    USE THIS WHEN: You need to know API costs, credit calculations, or rate limits.
    RETURNS: Pricing tiers, credit costs per endpoint, QPS limits by balance level.`,
          inputSchema: {
            type: "object",
            properties: {},
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown with: Credit System (USD to credits), Endpoint Costs table, Minimum Charge, QPS Limits by balance level, Important Notes, Cost Comparison"
                    }
                  }
                }
              }
            }
          }
        },
        {
          name: "get_twitterapi_auth",
          description: `Get TwitterAPI.io authentication guide: API key usage, headers, code examples.
    
    USE THIS WHEN: You need to set up authentication or see request examples.
    RETURNS: API key header format, base URL, cURL/Python/JavaScript examples.`,
          inputSchema: {
            type: "object",
            properties: {},
          },
          outputSchema: {
            type: "object",
            properties: {
              content: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    type: { type: "string", enum: ["text"] },
                    text: {
                      type: "string",
                      description: "Markdown with: API Key Usage header name, Base URL, Getting Your API Key steps, Request Examples (cURL, Python, JavaScript code blocks)"
                    }
                  }
                }
              }
            }
          }
        },
      ],
    }));
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 of behavioral disclosure. It effectively describes what the tool returns (API key header format, base URL, code examples) and implies it's a read-only informational tool. However, it doesn't mention potential limitations like rate limits or authentication requirements for accessing the guide itself.

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 perfectly structured with clear sections: purpose statement, usage guidelines, and return values. Every sentence earns its place with no wasted words. The information is front-loaded and efficiently organized.

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 has no parameters, has an output schema, and provides clear documentation of what it returns, the description is complete. It explains exactly what the tool does, when to use it, and what to expect in return, which is sufficient for this informational tool.

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 tool has 0 parameters with 100% schema description coverage. The description appropriately doesn't waste space discussing non-existent parameters. A baseline of 4 is appropriate for zero-parameter tools where the schema already fully documents the empty input structure.

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's purpose: 'Get TwitterAPI.io authentication guide' with specific details about what it provides (API key usage, headers, code examples). It distinguishes itself from siblings like get_twitterapi_endpoint or get_twitterapi_guide by focusing specifically on authentication setup.

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 set up authentication or see request examples.' This provides clear guidance on the appropriate context for using this tool versus alternatives.

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