Grafana MCP not working

error:

DEBUG Getting function search_dashboards                                                                                                              
DEBUG Running: search_dashboards(query=jio)                                                                                                          
DEBUG Calling MCP Tool 'search_dashboards' with args: {'tool_description': '\nSearch dashboards in the Grafana instance.\n', 'query': 'jio'}         
▰▱▱▱▱▱▱ Thinking...
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                                                                                                                    ┃
┃ find jio dashboard                                                                                                                                ┃
┃                                                                                                                                                    ┃
ERROR    Failed to call MCP tool 'search_dashboards': Error from MCP tool 'search_dashboards': [TextContent(type='text', text="Error executing tool   
         search_dashboards: 1 validation error for search_dashboardsArguments\narguments\n  Field required [type=missing,                             
         input_value={'tool_description': '\\nS...ce.\\n', 'query': 'jio'}, input_type=dict]\n    For further information visit                      
https://errors.pydantic.dev/2.11/v/missing", annotations=None)]                                                                              
         Traceback (most recent call last):                                                                                                           
           File "/Users/B0301571/projects/agentic/.agentic/lib/python3.13/site-packages/agno/utils/mcp.py", line 37, in call_tool                     
             raise Exception(f"Error from MCP tool '{tool_name}': {result.content}")                                                                  
         Exception: Error from MCP tool 'search_dashboards': [TextContent(type='text', text="Error executing tool search_dashboards: 1 validation     
         error for search_dashboardsArguments\narguments\n  Field required [type=missing, input_value={'tool_description': '\\nS...ce.\\n', 'query':  
         'jio'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.11/v/missing", annotations=None)]                 
DEBUG ============================================================== tool ==============================================================              
DEBUG Tool call Id: call_0HpHBLKufk1kU7m7F2psuT                                                                                                     
DEBUG Error: Error from MCP tool 'search_dashboards': [TextContent(type='text', text="Error executing tool search_dashboards: 1 validation error for  
      search_dashboardsArguments\narguments\n  Field required [type=missing, input_value={'tool_description': '\\nS...ce.\\n', 'query': 'jio'},      
      input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.11/v/missing", annotations=None)]                             
DEBUG *********************************************************  TOOL METRICS  *********************************************************              
DEBUG * Time:                        0.0130s                                                                                                          
DEBUG *********************************************************  TOOL METRICS  *********************************************************              
DEBUG =========================================================== assistant ============================================================

code:

import asyncio
from pathlib import Path
from textwrap import dedent
from agno.models.azure import AzureOpenAI
from agno.agent import Agent
from agno.tools.mcp import MCPTools
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
import json

def load_grafana_server_config():
    """Load Grafana MCP server configuration from config.json."""
    with open("config.json", "r") as config_file:
        config = json.load(config_file)
        return config["mcpServers"]["grafana"]

async def create_grafana_agent(grafana_session):
    """Create and configure an agent with only the Grafana MCP tool."""
    grafana_tools = MCPTools(session=grafana_session)
    await grafana_tools.initialize()

    return Agent(
        model=AzureOpenAI(id="gpt-4o-mini", api_version="2024-06-01-preview"),
        tools=[grafana_tools],
        instructions=dedent("""\
            You are a Grafana dashboard assistant. Help users explore Grafana dashboards and metrics.
            - my grafana endpoint is http://newsights.jio.in
            - Search for dashboards by title and tags
            - List and describe available dashboards
            - Show metrics and data from dashboards
            - Focus on providing relevant dashboard information
            - Be concise and organized in your responses
        """),
        markdown=True,
        show_tool_calls=True,
        debug_mode=True
    )

async def run_agent(message: str) -> None:
    """Run the Grafana-only agent with the given message."""
    # Load Grafana server configuration
    grafana_config = load_grafana_server_config()
    grafana_params = StdioServerParameters(
        command=grafana_config["command"],
        args=grafana_config["args"],
        env=grafana_config.get("env", {})
    )

    # Start only the Grafana MCP server
    async with stdio_client(grafana_params) as (grafana_read, grafana_write):
        async with ClientSession(grafana_read, grafana_write) as grafana_session:
            agent = await create_grafana_agent(grafana_session)
            await agent.aprint_response(message, stream=True)

if __name__ == "__main__":
    query = "Find all dashboards related to jio and list them with their IDs"
    asyncio.run(run_agent(query))