Skip to main content
Glama
SlideSpeak
by SlideSpeak

upload_document

Upload a document file to get a task ID for processing. Supports .pptx, .ppt, .docx, .doc, .xlsx, .pdf files.

Instructions

Upload a document file and return the task_id for processing.
Supported file types: .pptx, .ppt, .docx, .doc, .xlsx, .pdf

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • Handler function for the upload_document MCP tool. It takes a file_path parameter, reads the file from disk, and uploads it via a POST multipart request to the SlideSpeak API's /document/upload endpoint. Returns the JSON response from the API.
    @mcp.tool()
    async def upload_document(file_path: str) -> str:
        """
        Upload a document file and return the task_id for processing.
        Supported file types: .pptx, .ppt, .docx, .doc, .xlsx, .pdf
        """
        if not API_KEY:
            return "API Key is missing. Cannot process any requests."
    
        url = f"{API_BASE}/document/upload"
        headers = {
            "User-Agent": USER_AGENT,
            "X-API-Key": API_KEY,
        }
    
        if not os.path.isfile(file_path):
            return f"File not found: {file_path}"
    
        try:
            async with httpx.AsyncClient(timeout=DEFAULT_TIMEOUT) as client:
                with open(file_path, "rb") as f:
                    files = {"file": (os.path.basename(file_path), f)}
                    response = await client.post(url, headers=headers, files=files)
                    response.raise_for_status()
                    data = response.json()
                    return json.dumps(data)
        except httpx.HTTPStatusError as e:
            logging.error(f"HTTP error uploading document: {e.response.status_code} - {e.response.text}")
            return f"Upload failed: {e.response.status_code} {e.response.text}"
        except Exception as e:
            logging.error(f"Unexpected error uploading document: {str(e)}")
            return f"Upload failed: {str(e)}"
  • slidespeak.py:404-404 (registration)
    Registration of upload_document as an MCP tool via the @mcp.tool() decorator.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, and the description only states it returns a task_id, implying asynchronous processing. It lacks details on side effects, authentication requirements, rate limits, or what happens to the file after upload.

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 extremely concise, with only two sentences that convey essential information without any extraneous content. Every sentence is necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and only one parameter, the description is adequate but incomplete. It mentions the return of a task_id but does not explain how to interpret it or what the task does. It also lacks guidance on file size limits or error handling.

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 0% description coverage, so the description's mention of supported file types adds some value. However, it does not explain the file_path parameter semantics (e.g., path format, existence checks), leaving the agent to infer from the name alone.

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 that the tool uploads a document file and returns a task_id for processing, which differentiates it from sibling tools like download_presentation or generate_powerpoint. However, it could be more specific about what 'processing' entails.

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

Usage Guidelines3/5

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

Supported file types are listed, implying when the tool can be used, but there is no explicit guidance on when to use this tool versus alternatives like generate_powerpoint or direct file operations. No exclusions or prerequisites are mentioned.

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/SlideSpeak/slidespeak-mcp'

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