Skip to main content
Glama

search_posts

Find and retrieve public Medium stories based on a search query. Specify limit to control results count.

Instructions

Read-only. Medium-side search across public stories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Implementation Reference

  • MediumClient.search_posts – executes the GraphQL query against Medium's _/graphql endpoint. Accepts 'query' (required) and 'limit' (default 10). Returns post items with id, title, mediumUrl, firstPublishedAt, clapCount, and creator info.
    def search_posts(self, *, query: str, limit: int = 10) -> list[dict[str, Any]]:
        data = self._gql(
            operation="SearchPosts",
            query="""
            query SearchPosts($query: String!, $paging: PagingOptions) {
              search(query: $query) {
                posts(paging: $paging) {
                  items {
                    id
                    title
                    mediumUrl
                    firstPublishedAt
                    clapCount
                    creator { id username name }
                  }
                }
              }
            }
            """,
            variables={"query": query, "paging": {"limit": limit}},
        )
        items = (((data.get("search") or {}).get("posts") or {}).get("items")) or []
        return items[:limit]
  • Tool schema/registration in the TOOLS dict. Defines search_posts as a read-only tool requiring 'query' (string), with optional 'limit' (integer, default 10).
    "search_posts": {
        "description": (
            "Read-only. Medium-side search across public stories."
        ),
        "input_schema": {
            "type": "object",
            "properties": {
                "query": {"type": "string"},
                "limit": {"type": "integer", "default": 10},
            },
            "required": ["query"],
        },
    },
  • Dispatch handler in _dispatch() that routes the 'search_posts' tool call to MediumClient.search_posts, passing query (required) and limit (default 10).
    if name == "search_posts":
        return c.search_posts(query=args["query"], limit=args.get("limit", 10))
  • CLI helper wrapper that calls the same client.search_posts method from the command line interface.
    def posts_search(
        query: str,
        limit: int = typer.Option(10, "--limit"),
    ) -> None:
        """Medium-side full-text search."""
        with _client() as c:
            _json(c.search_posts(query=query, limit=limit))
Behavior2/5

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

The description labels the tool as 'Read-only', which is a positive disclosure. However, with no annotations, it fails to elaborate on other behavioral aspects such as authentication requirements, rate limits, or pagination behavior, relying solely on this single trait.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of a single sentence with no redundancy. However, the inclusion of the ambiguous 'Medium-side' undermines clarity, and the structure lacks specifics beyond the read-only note.

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 simplicity (two parameters, no output schema, no annotations), the description is insufficient. It does not specify the search scope (e.g., what constitutes 'public stories'), result ordering, or return structure, leaving significant gaps for correct agent invocation.

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

Parameters1/5

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

Input parameters 'query' and 'limit' are left entirely undescribed in both schema and description. The description only mentions 'search' but does not clarify what the query should be or how the limit affects results, offering zero additive value for parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'search across public stories', which clearly identifies the tool's purpose as a search function. However, the term 'Medium-side' is vague and may confuse, and it does not explicitly differentiate from sibling tools like list_posts or get_feed.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention any context or conditions for appropriate use, leaving the agent without decision support.

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/06ketan/medium-ops'

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