Skip to main content
Glama
javerthl

ServiceNow MCP Server

by javerthl

list_tool_packages

List available tool packages and identify the currently loaded package in the ServiceNow MCP Server to manage ServiceNow API operations.

Instructions

Lists available tool packages and the currently loaded one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
random_stringYesDummy parameter for no-parameter tools

Implementation Reference

  • The core handler function that implements the logic for the 'list_tool_packages' tool, returning information about the current and available tool 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." ), }
  • Registers the 'list_tool_packages' tool in the _list_tools_impl method, including its name, description, and input schema (dummy param for no-arg tool).
    if self.current_package_name != "none": tool_list.append( 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"], }, ) )
  • Special dispatch handler in _call_tool_impl for 'list_tool_packages', checks package, calls impl, serializes, 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)]
  • The input schema definition for the 'list_tool_packages' tool, using a dummy required string parameter since it's a no-arg tool.
    inputSchema={ "type": "object", "properties": { "random_string": { "type": "string", "description": "Dummy parameter for no-parameter tools", } }, "required": ["random_string"], },

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/javerthl/servicenow-mcp'

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