Skip to main content
Glama
cjkcr

X(Twitter) MCP Server

by cjkcr

list_drafts

Retrieve and view all saved draft tweets and threads stored in the X(Twitter) MCP Server for review and management before publishing.

Instructions

List all draft tweets and threads

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_drafts' tool. It lists all JSON files in the 'drafts' directory, loads their contents, and returns a JSON-formatted list of draft objects including ID and content.
    async def handle_list_drafts(arguments: Any) -> Sequence[TextContent]:
        try:
            drafts = []
            if os.path.exists("drafts"):
                for filename in os.listdir("drafts"):
                    filepath = os.path.join("drafts", filename)
                    with open(filepath, "r") as f:
                        draft = json.load(f)
                    drafts.append({"id": filename, "draft": draft})
            return [
                TextContent(
                    type="text",
                    text=json.dumps(drafts, indent=2),
                )
            ]
        except Exception as e:
            logger.error(f"Error listing drafts: {str(e)}")
            raise RuntimeError(f"Error listing drafts: {str(e)}")
  • Registration of the 'list_drafts' tool within the @server.list_tools() function, including its name, description, and empty input schema (no parameters required).
    Tool(
        name="list_drafts",
        description="List all draft tweets and threads",
        inputSchema={
            "type": "object",
            "properties": {},
            "required": [],
        },
    ),
  • Input schema for the 'list_drafts' tool, which is an empty object (no input parameters required).
        inputSchema={
            "type": "object",
            "properties": {},
            "required": [],
        },
    ),
  • Dispatch/registration of the 'list_drafts' handler within the general @server.call_tool() function.
    elif name == "list_drafts":
        return await handle_list_drafts(arguments)
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as whether listing is paginated, if it requires authentication, what format the output returns, or any rate limits. This leaves significant gaps in understanding the tool's behavior.

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 with zero waste. It's front-loaded with the core purpose and avoids any redundant or verbose phrasing, making it highly concise and well-structured.

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 lack of annotations and output schema, the description is incomplete. It doesn't address what the output looks like (e.g., list format, fields included), behavioral aspects like pagination, or error conditions. For a tool that likely returns data, this leaves the agent under-informed.

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, so no parameter documentation is needed. The description appropriately doesn't mention parameters, earning a baseline score of 4 for not adding unnecessary information.

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 action ('List') and target resources ('all draft tweets and threads'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'create_draft_tweet' or 'delete_draft' beyond the listing action, which prevents a perfect score.

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 'publish_draft' or 'delete_draft'. It lacks context about prerequisites, timing, or exclusions, leaving the agent with minimal usage direction.

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/cjkcr/x-mcp'

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