Skip to main content
Glama
SlideSpeak
by SlideSpeak

get_available_templates

Retrieve a list of all available presentation templates to choose from when creating a new slideshow.

Instructions

Get all available presentation templates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_available_templates' tool. Decorated with @mcp.tool(), it fetches available presentation templates from the /presentation/templates API endpoint and formats them into a readable string.
    @mcp.tool()
    async def get_available_templates() -> str:
        """Get all available presentation templates."""
        templates_endpoint = "/presentation/templates"
    
        if not API_KEY:
            return "API Key is missing. Cannot process any requests."
    
        templates_data = await _make_api_request("GET", templates_endpoint)
    
        if not templates_data:
            return "Unable to fetch templates due to an API error. Check server logs."
    
        if not isinstance(templates_data, list):
             return f"Unexpected response format received for templates: {type(templates_data).__name__}"
    
        formatted_templates = "Available templates:\n"
        for template in templates_data:
            name = template.get("name", "default")
            images = template.get("images", {})
            cover = images.get("cover", "No cover image URL")
            content = images.get("content", "No content image URL")
            formatted_templates += f"- {name}\n  Cover: {cover}\n  Content: {content}\n\n"
    
        return formatted_templates.strip()
  • slidespeak.py:81-81 (registration)
    The tool is registered as an MCP tool via the @mcp.tool() decorator on line 81, automatically registering it with the FastMCP server instance named 'mcp'.
    @mcp.tool()
  • The _make_api_request helper function used by get_available_templates to make the GET request to the /presentation/templates endpoint. Handles HTTP calls, logging, and error handling.
    async def _make_api_request(
        method: Literal["GET", "POST"],
        endpoint: str,
        payload: Optional[dict[str, Any]] = None,
        timeout: float = DEFAULT_TIMEOUT
    ) -> Optional[dict[str, Any]]:
        """
        Makes an HTTP request to the SlideSpeak API.
    
        Args:
            method: HTTP method ('GET' or 'POST').
            endpoint: API endpoint path (e.g., '/presentation/templates').
            payload: JSON payload for POST requests. Ignored for GET.
            timeout: Request timeout in seconds.
    
        Returns:
            The parsed JSON response as a dictionary on success, None on failure.
        """
        if not API_KEY:
            logging.error("API Key is missing. Cannot make API request.")
            return None
    
        headers = {
            "User-Agent": USER_AGENT,
            "Accept": "application/json",
            "X-API-Key": API_KEY,
        }
    
        url = f"{API_BASE}{endpoint}"
        req_start = time.time()
    
        async with httpx.AsyncClient() as client:
            try:
                if method == "POST":
                    response = await client.post(url, json=payload, headers=headers, timeout=timeout)
                else:
                    response = await client.get(url, headers=headers, timeout=timeout)
    
                elapsed = time.time() - req_start
                logging.info(f"{method} {url} | status={response.status_code} | elapsed={elapsed:.2f}s")
                response.raise_for_status()
                return response.json()
    
            except httpx.HTTPStatusError as e:
                logging.error(f"HTTP error {method} {url}: {e.response.status_code} - {e.response.text}")
            except httpx.RequestError as e:
                logging.error(f"Request error {method} {url}: {str(e)}")
            except Exception as e:
                logging.error(f"Unexpected error {method} {url}: {str(e)}")
    
            return None
Behavior2/5

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

With no annotations, the description carries full burden but only states the high-level action. It does not disclose behavioral traits such as read-only nature, output structure, or any limits, leaving the agent to infer basic retrieval 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, front-loaded sentence with no unnecessary words. It is maximally concise while conveying the core purpose.

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?

Despite the tool's simplicity, the description omits what the output looks like (e.g., list of template IDs/names) and any additional context about the templates. With no output schema, the description should compensate, but it does not.

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 input schema has zero parameters, so schema description coverage is 100%. The description adds no parameter information, which is acceptable given no parameters exist. Baseline for zero parameters is 4.

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 verb 'Get' and the resource 'available presentation templates', with no ambiguity. It distinguishes itself from sibling tools, which are for downloading, generating, or uploading, not listing templates.

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?

No explicit when-to-use or alternative guidance is provided. The usage is implied as a preliminary step before generating or downloading a presentation, but the description does not state this context.

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