Skip to main content
Glama

list_tools

Discover available MCP tools in the Splunk server to understand their functions and parameters for data interaction.

Instructions

List all available MCP tools.

Returns:
    List of all available tools with their name, description, and parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_tools` MCP tool handler. Registered via `@mcp.tool()` decorator. Returns a list of all available tools by inspecting the MCP server's internal tools registry (trying mcp._tools, mcp.tools(), or mcp.registered_tools). No input parameters required.
    @mcp.tool()
    async def list_tools() -> List[Dict[str, Any]]:
        """
        List all available MCP tools.
        
        Returns:
            List of all available tools with their name, description, and parameters.
        """
        try:
            logger.info("🧰 Listing available MCP tools...")
            tools_list = []
            
            # Try to access tools from different potential attributes
            if hasattr(mcp, '_tools') and isinstance(mcp._tools, dict):
                # Direct access to the tools dictionary
                for name, tool_info in mcp._tools.items():
                    try:
                        tool_data = {
                            "name": name,
                            "description": tool_info.get("description", "No description available"),
                            "parameters": tool_info.get("parameters", {})
                        }
                        tools_list.append(tool_data)
                    except Exception as e:
                        logger.warning(f"⚠️ Error processing tool {name}: {str(e)}")
                        continue
                        
            elif hasattr(mcp, 'tools') and callable(getattr(mcp, 'tools', None)):
                # Tools accessed as a method
                for name, tool_info in mcp.tools().items():
                    try:
                        tool_data = {
                            "name": name,
                            "description": tool_info.get("description", "No description available"),
                            "parameters": tool_info.get("parameters", {})
                        }
                        tools_list.append(tool_data)
                    except Exception as e:
                        logger.warning(f"⚠️ Error processing tool {name}: {str(e)}")
                        continue
                        
            elif hasattr(mcp, 'registered_tools') and isinstance(mcp.registered_tools, dict):
                # Access through registered_tools attribute
                for name, tool_info in mcp.registered_tools.items():
                    try:
                        description = (
                            tool_info.get("description", None) or 
                            getattr(tool_info, "description", None) or
                            "No description available"
                        )
                        
                        parameters = (
                            tool_info.get("parameters", None) or 
                            getattr(tool_info, "parameters", None) or
                            {}
                        )
                        
                        tool_data = {
                            "name": name,
                            "description": description,
                            "parameters": parameters
                        }
                        tools_list.append(tool_data)
                    except Exception as e:
                        logger.warning(f"⚠️ Error processing tool {name}: {str(e)}")
                        continue
            
            # Sort tools by name for consistent ordering
            tools_list.sort(key=lambda x: x["name"])
            
            logger.info(f"✅ Found {len(tools_list)} tools")
            return tools_list
            
        except Exception as e:
            logger.error(f"❌ Error listing tools: {str(e)}")
            raise
  • splunk_mcp.py:787-787 (registration)
    Registration of the `list_tools` tool using the FastMCP `@mcp.tool()` decorator, which also infers the input schema from the function signature (empty parameters).
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the return format ('List of all available tools with their name, description, and parameters'), which is helpful. However, it doesn't disclose important behavioral traits like whether this is a read-only operation, if it requires authentication, rate limits, or pagination behavior. The description provides some output information but misses key operational details.

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 and well-structured. Two sentences efficiently convey the tool's purpose and return format with zero wasted words. It's front-loaded with the core functionality and follows with return details.

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 the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains what the tool does and what it returns, but doesn't provide context about when to use it or behavioral constraints. For a tool with no structured metadata, the description should do more to compensate, particularly around usage guidelines and operational behavior.

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. The description doesn't need to explain parameters since none exist. It appropriately focuses on the tool's function and return value rather than parameter details. The baseline for 0 parameters is 4.

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: 'List all available MCP tools' with a specific verb ('List') and resource ('MCP tools'). It distinguishes from siblings by focusing on tools rather than users, indexes, searches, etc. However, it doesn't explicitly differentiate from similar listing tools like list_indexes or list_users beyond the resource type.

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 doesn't mention prerequisites, timing considerations, or compare it to other listing tools. It simply states what it does without context about when it's appropriate.

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/livehybrid/splunk-mcp'

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