list_tool_packages
Discover available tool packages and identify the currently loaded one in the ServiceNow MCP Server to manage integration capabilities.
Instructions
Lists available tool packages and the currently loaded one.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| random_string | Yes | Dummy parameter for no-parameter tools |
Implementation Reference
- src/servicenow_mcp/server.py:290-300 (handler)Core implementation function that computes and returns the dictionary with current tool package and list of available packages.def _list_tool_packages_impl(self) -> Dict[str, Any]: """Implementation logic for the list_tool_packages tool.""" available_packages = list(self.package_definitions.keys()) return { "current_package": self.current_package_name, "available_packages": available_packages, "message": ( f"Currently loaded package: '{self.current_package_name}'. " f"Set MCP_TOOL_PACKAGE env var to one of {available_packages} to switch." ), }
- src/servicenow_mcp/server.py:240-248 (handler)Dispatch logic in call_tool_impl that handles the list_tool_packages tool invocation, checks package, calls impl, serializes to JSON, and returns TextContent.if name == "list_tool_packages": if self.current_package_name == "none": raise ValueError( "Tool 'list_tool_packages' is not available in the 'none' package." ) result_dict = self._list_tool_packages_impl() serialized_string = json.dumps(result_dict, indent=2) # Return a list with a TextContent object return [types.TextContent(type="text", text=serialized_string)]
- src/servicenow_mcp/server.py:186-199 (registration)Registers the list_tool_packages tool in the list_tools MCP endpoint response (conditionally if not 'none' package), including name, description, and input schema.types.Tool( name="list_tool_packages", description="Lists available tool packages and the currently loaded one.", inputSchema={ "type": "object", "properties": { "random_string": { "type": "string", "description": "Dummy parameter for no-parameter tools", } }, "required": ["random_string"], }, )
- src/servicenow_mcp/server.py:189-197 (schema)Input schema for list_tool_packages tool, using a dummy required string parameter since MCP requires at least one.inputSchema={ "type": "object", "properties": { "random_string": { "type": "string", "description": "Dummy parameter for no-parameter tools", } }, "required": ["random_string"],