Skip to main content
Glama
shubhamekapure

Social Search MCP

search_social

Search specific social media platforms like Facebook, Instagram, Twitter, and others to find relevant content using targeted queries, time filters, and location parameters.

Instructions

Perform a web search focused ONLY on specific social media platforms.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query (e.g. 'rent listings', 'used bike')
platformsNoList of platforms to search. Options: facebook, instagram, twitter, reddit, linkedin, snapchat, tiktok, pinterest. Defaults to searching all if omitted.
max_resultsNoMax number of results to retrieve (default: 10, max: 30)
time_filterNoOptional time filter. Options: 'day', 'week', 'month', 'year'. Leave empty for relevance sorting.
glNoOptional geolocation code (e.g. 'in' for India, 'us' for USA).
hlNoOptional language code (e.g. 'hi' for Hindi, 'en' for English).

Implementation Reference

  • The handle_call_tool function processes the 'search_social' tool call, constructs a domain-limited query, selects a search provider (SearXNG, Serper, or Google), and formats the results.
    @server.call_tool()
    async def handle_call_tool(
        name: str, arguments: dict | None
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        if name != "search_social":
            raise ValueError(f"Unknown tool: {name}")
    
        if not arguments or "query" not in arguments:
            raise ValueError("Missing required 'query' argument")
    
        query = arguments.get("query")
        requested_platforms = arguments.get("platforms", [])
        max_results = min(arguments.get("max_results", 10), 30)
        time_filter = arguments.get("time_filter")
        gl = arguments.get("gl")
        hl = arguments.get("hl")
    
        domains = []
        if requested_platforms:
            for p in requested_platforms:
                p_lower = p.lower()
                if p_lower in PLATFORMS:
                    domains.append(PLATFORMS[p_lower])
                elif "." in p_lower:
                    domains.append(p_lower)
        else:
            domains = list(PLATFORMS.values())
    
        site_query = " OR ".join([f"site:{d}" for d in domains])
        final_query = f"{query} ({site_query})".strip()
    
        provider = os.environ.get("SEARCH_PROVIDER", "searxng").lower()
        
        if provider == "searxng":
            results = search_searxng(final_query, max_results=max_results, time_filter=time_filter)
        elif provider == "serper":
            results = search_serper(final_query, max_results=max_results, time_filter=time_filter, gl=gl, hl=hl)
        elif provider == "google":
            results = search_google(final_query, max_results=max_results, time_filter=time_filter)
        else:
            return [types.TextContent(type="text", text=f"ERROR: Unknown SEARCH_PROVIDER '{provider}'. Use 'searxng', 'serper', or 'google'.")]
    
        if isinstance(results, str):  # Error message returned
            return [types.TextContent(type="text", text=results)]
            
        if not results:
            return [types.TextContent(type="text", text=f"No results found from provider '{provider}'.")]
    
        formatted_results = "\\n\\n".join(
            [f"Title: {r.get('title')}\\nURL: {r.get('url')}\\nSnippet: {r.get('snippet')}" for r in results]
        )
    
        return [types.TextContent(type="text", text=formatted_results)]
  • Tool registration and definition of input schema for the 'search_social' tool.
    @server.list_tools()
    async def handle_list_tools() -> list[types.Tool]:
        return [
            types.Tool(
                name="search_social",
                description="Perform a web search focused ONLY on specific social media platforms.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "query": {
                            "type": "string",
                            "description": "The search query (e.g. 'rent listings', 'used bike')"
                        },
                        "platforms": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "List of platforms to search. Options: facebook, instagram, twitter, reddit, linkedin, snapchat, tiktok, pinterest. Defaults to searching all if omitted."
                        },
                        "max_results": {
                            "type": "integer",
                            "description": "Max number of results to retrieve (default: 10, max: 30)"
                        },
                        "time_filter": {
                            "type": "string",
                            "description": "Optional time filter. Options: 'day', 'week', 'month', 'year'. Leave empty for relevance sorting."
                        },
                        "gl": {
                            "type": "string",
                            "description": "Optional geolocation code (e.g. 'in' for India, 'us' for USA)."
                        },
                        "hl": {
                            "type": "string",
                            "description": "Optional language code (e.g. 'hi' for Hindi, 'en' for English)."
                        }
                    },
                    "required": ["query"]
                }
            )
        ]
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It states the tool performs a 'web search' but does not explain how results are retrieved, formatted, or limited (e.g., pagination, rate limits, authentication needs). The description lacks details on error handling, response structure, or operational constraints, leaving significant gaps in behavioral understanding.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an AI agent to parse quickly. This optimal conciseness earns the highest score.

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 tool's complexity (6 parameters, no output schema, no annotations), the description is incomplete. It lacks details on behavioral traits, usage context, and output expectations. Without annotations or an output schema, the description should provide more comprehensive guidance to help the agent understand how to invoke and interpret results, but it falls short.

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, providing clear details for all 6 parameters. The description adds no additional parameter semantics beyond implying a focus on social media platforms, which is somewhat redundant with the schema's 'platforms' parameter. With high schema coverage, the baseline score of 3 is appropriate, as the description does not compensate with extra insights.

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 tool's purpose: 'Perform a web search focused ONLY on specific social media platforms.' It specifies the verb ('search'), resource ('social media platforms'), and scope ('web search focused ONLY on specific...'). However, with no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, preventing a score of 5.

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, prerequisites, or exclusions. It mentions the focus on social media platforms but does not clarify use cases, limitations, or comparisons to other search tools. This lack of contextual guidance limits its utility for an AI agent.

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/shubhamekapure/social-search-mcp'

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