|  | 
| 10 | 10 |     "This example aspires to verify the points listed in [POC - AI with Splunk Apps](https://cisco-my.sharepoint.com/:w:/r/personal/hbalacha_cisco_com/Documents/POC%20-%20AI%20with%20Splunk%20Apps.docx?d=w2776e089011943abbd84c0fa30a53f34&csf=1&web=1&e=RxvShR)\n", | 
| 11 | 11 |     "\n", | 
| 12 | 12 |     "- Develop @tool Decorator\n", | 
| 13 |  | -    "  - [ ] Capture e.g. tool_name, description, inputs, outputs\n" | 
| 14 |  | -   ] | 
| 15 |  | -  }, | 
| 16 |  | -  { | 
| 17 |  | -   "cell_type": "markdown", | 
| 18 |  | -   "id": "363201e8", | 
| 19 |  | -   "metadata": {}, | 
| 20 |  | -   "source": [ | 
| 21 |  | -    "- MCP JSONSchema can (and most probably should) be used for tool registration in Splunk" | 
| 22 |  | -   ] | 
| 23 |  | -  }, | 
| 24 |  | -  { | 
| 25 |  | -   "cell_type": "code", | 
| 26 |  | -   "execution_count": null, | 
| 27 |  | -   "id": "c349a502", | 
| 28 |  | -   "metadata": {}, | 
| 29 |  | -   "outputs": [], | 
| 30 |  | -   "source": [ | 
| 31 |  | -    "from fastmcp import Client\n", | 
| 32 |  | -    "from mcp.types import Tool\n", | 
| 33 |  | -    "\n", | 
| 34 |  | -    "MCP_SERVER_HOST: str = \"0.0.0.0\"\n", | 
| 35 |  | -    "MCP_SERVER_PORT: int = 2137\n", | 
| 36 |  | -    "\n", | 
| 37 |  | -    "\n", | 
| 38 |  | -    "conn_str = f\"http://{MCP_SERVER_HOST}:{MCP_SERVER_PORT}/mcp\"\n", | 
| 39 |  | -    "mcp_client = Client(\"./tools.py\")\n", | 
| 40 |  | -    "\n", | 
|  | 13 | +    "  - [ ] Capture e.g. tool_name, description, inputs, outputs\n", | 
| 41 | 14 |     "\n", | 
| 42 |  | -    "async def get_tools() -> list[Tool]:\n", | 
| 43 |  | -    "    tools = []\n", | 
| 44 |  | -    "    async with mcp_client:\n", | 
| 45 |  | -    "        tools = await mcp_client.list_tools()\n", | 
| 46 |  | -    "\n", | 
| 47 |  | -    "    return tools\n", | 
| 48 |  | -    "\n", | 
| 49 |  | -    "\n", | 
| 50 |  | -    "call_tool_result = await get_tools()\n", | 
| 51 |  | -    "for tool in call_tool_result:\n", | 
| 52 |  | -    "    print(tool.name)\n", | 
| 53 |  | -    "    print(tool.description)\n", | 
| 54 |  | -    "    print(tool.inputSchema)\n", | 
| 55 |  | -    "    print(tool.outputSchema)\n", | 
| 56 |  | -    "    print(tool.meta)" | 
| 57 |  | -   ] | 
| 58 |  | -  }, | 
| 59 |  | -  { | 
| 60 |  | -   "cell_type": "markdown", | 
| 61 |  | -   "id": "cd1da846", | 
| 62 |  | -   "metadata": {}, | 
| 63 |  | -   "source": [ | 
|  | 15 | +    "- MCP JSONSchema can (and most probably should) be used for tool registration in Splunk\n", | 
| 64 | 16 |     "- execution_mode (external_http)\n", | 
| 65 | 17 |     "  - Is this what MCP calls `transports`?\n", | 
| 66 | 18 |     "- execution_metadata (endpoint URL)\n", | 
|  | 
| 74 | 26 |    "metadata": {}, | 
| 75 | 27 |    "outputs": [], | 
| 76 | 28 |    "source": [ | 
|  | 29 | +    "from fastmcp.client import Client\n", | 
|  | 30 | +    "\n", | 
| 77 | 31 |     "mcp_client = Client(\"tools.py\")\n", | 
| 78 | 32 |     "\n", | 
| 79 | 33 |     "\n", | 
|  | 
| 89 | 43 |     "\n", | 
| 90 | 44 |     "[print(data) for data in call_tool_result.data]\n" | 
| 91 | 45 |    ] | 
| 92 |  | -  }, | 
| 93 |  | -  { | 
| 94 |  | -   "cell_type": "markdown", | 
| 95 |  | -   "id": "2da04c9f", | 
| 96 |  | -   "metadata": {}, | 
| 97 |  | -   "source": [ | 
| 98 |  | -    "- [ ] Support YAML v2 Tool Definition\n", | 
| 99 |  | -    "- [ ] Merge decorator + YAML for complete metadata\n", | 
| 100 |  | -    "\n", | 
| 101 |  | -    "- Implement Post-Install Script (sdk_post_install.py):\n", | 
| 102 |  | -    "  - [ ] Load app modules → decorators populate RegisteredTools\n", | 
| 103 |  | -    "  - [ ] Merge YAML/decorator metadata\n", | 
| 104 |  | -    "  - [ ] Build MCP /tools/register payload\n", | 
| 105 |  | -    "  - [ ] Call MCP registry with credentials (from App Manager)\n", | 
| 106 |  | -    "  - [ ] Log success/fail to MCP audit\n" | 
| 107 |  | -   ] | 
| 108 | 46 |   } | 
| 109 | 47 |  ], | 
| 110 | 48 |  "metadata": { | 
|  | 
0 commit comments