Skip to main content
Glama

health_check

Check Splunk connection status and list installed applications to verify system availability and configuration.

Instructions

Get basic Splunk connection information and list available apps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The health_check tool handler: connects to Splunk using get_splunk_connection(), lists available apps, and returns connection info and apps list.
    @mcp.tool()
    async def health_check() -> Dict[str, Any]:
        """Get basic Splunk connection information and list available apps"""
        try:
            service = get_splunk_connection()
            logger.info("🏥 Performing health check...")
            
            # List available apps
            apps = []
            for app in service.apps:
                try:
                    app_info = {
                        "name": app['name'],
                        "label": app['label'],
                        "version": app['version']
                    }
                    apps.append(app_info)
                except Exception as e:
                    logger.warning(f"⚠️ Error getting info for app {app['name']}: {str(e)}")
                    continue
            
            response = {
                "status": "healthy",
                "connection": {
                    "host": SPLUNK_HOST,
                    "port": SPLUNK_PORT,
                    "scheme": SPLUNK_SCHEME,
                    "username": os.environ.get("SPLUNK_USERNAME", "admin"),
                    "ssl_verify": VERIFY_SSL
                },
                "apps_count": len(apps),
                "apps": apps
            }
            
            logger.info(f"✅ Health check successful. Found {len(apps)} apps")
            return response
            
        except Exception as e:
            logger.error(f"❌ Health check failed: {str(e)}")
            raise
  • splunk_mcp.py:668-668 (registration)
    FastMCP decorator that registers the health_check function as an MCP tool.
    @mcp.tool()
  • Helper function to create a Splunk service connection, supporting token or username/password auth. Called by health_check.
    def get_splunk_connection() -> splunklib.client.Service:
        """
        Get a connection to the Splunk service.
        Supports both username/password and token-based authentication.
        If SPLUNK_TOKEN is set, it will be used for authentication and username/password will be ignored.
        Returns:
            splunklib.client.Service: Connected Splunk service
        """
        try:
            if SPLUNK_TOKEN:
                logger.debug(f"🔌 Connecting to Splunk at {SPLUNK_SCHEME}://{SPLUNK_HOST}:{SPLUNK_PORT} using token authentication")
                service = splunklib.client.connect(
                    host=SPLUNK_HOST,
                    port=SPLUNK_PORT,
                    scheme=SPLUNK_SCHEME,
                    verify=VERIFY_SSL,
                    token=f"Bearer {SPLUNK_TOKEN}"
                )
            else:
                username = os.environ.get("SPLUNK_USERNAME", "admin")
                logger.debug(f"🔌 Connecting to Splunk at {SPLUNK_SCHEME}://{SPLUNK_HOST}:{SPLUNK_PORT} as {username}")
                service = splunklib.client.connect(
                    host=SPLUNK_HOST,
                    port=SPLUNK_PORT,
                    username=username,
                    password=SPLUNK_PASSWORD,
                    scheme=SPLUNK_SCHEME,
                    verify=VERIFY_SSL
                )
            logger.debug(f"✅ Connected to Splunk successfully")
            return service
        except Exception as e:
            logger.error(f"❌ Failed to connect to Splunk: {str(e)}")
            raise
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it states what the tool does, it doesn't describe important behavioral aspects like authentication requirements, rate limits, error conditions, or what specific information constitutes 'basic Splunk connection information.' The description is functional but lacks operational context.

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 that communicates the complete purpose without any wasted words. It's appropriately sized for a zero-parameter diagnostic tool and front-loads the essential information. Every word earns its place in the description.

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 zero parameters and no output schema, the description adequately covers what the tool does but leaves important questions unanswered about return format, error handling, and authentication requirements. For a diagnostic tool that likely returns structured data about system health, more detail about what constitutes 'basic connection information' would be helpful.

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 zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters since none exist, which is correct for this case. A baseline of 4 is appropriate when no parameters need documentation.

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 tool's purpose with specific verbs ('Get', 'list') and resources ('basic Splunk connection information', 'available apps'), making it immediately understandable. It distinguishes this tool from siblings like 'ping' (simple connectivity) or 'list_users' (specific resource listing) by combining connection verification with app inventory.

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?

The description implies usage for checking Splunk connectivity and discovering apps, but doesn't explicitly state when to use this versus alternatives like 'ping' (simpler connectivity check) or 'list_saved_searches' (specific resource listing). No guidance is provided about when NOT to use this tool or what prerequisites might be needed.

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