Skip to main content
GET
/
mcp
/
tools
/
list
GET /mcp/tools/list
curl --request GET \
  --url https://api.example.com/mcp/tools/list
{
  "jsonrpc": "<string>",
  "result": {
    "tools": [
      {
        "name": "<string>",
        "description": "<string>",
        "inputSchema": {
          "type": "<string>",
          "properties": {},
          "required": [
            {}
          ]
        }
      }
    ]
  },
  "error": {
    "code": 123,
    "message": "<string>"
  }
}

Endpoint Details

Method: GET
Path: /mcp/tools/list
Authentication: None required (public endpoint)

Purpose

This endpoint returns a JSON-RPC 2.0 response containing all tools currently registered in HandsAI. LLM clients use this endpoint to discover which tools are available for execution. Tools are dynamically loaded from the database and cached for performance. Each tool includes:
  • A unique name (code)
  • A human-readable description
  • An inputSchema defining required and optional parameters

Request Format

This is a simple GET request with no parameters required:
curl http://localhost:8080/mcp/tools/list
Alternatively, you can send a JSON-RPC request body (though the controller ignores it for GET requests):
{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "id": "1"
}

Response Schema

The response follows JSON-RPC 2.0 format:
jsonrpc
string
required
Always "2.0" indicating JSON-RPC protocol version
result
object
required
Contains the tools list result
error
object
Present only if an error occurred (replaces result)

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "tools": [
      {
        "name": "weather_get",
        "description": "Get current weather for a location",
        "inputSchema": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "City name or coordinates"
            },
            "units": {
              "type": "string",
              "description": "Temperature units (celsius or fahrenheit)"
            }
          },
          "required": ["location"]
        }
      },
      {
        "name": "search_documents",
        "description": "Search through indexed documents",
        "inputSchema": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "description": "Search query string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by document tags"
            },
            "limit": {
              "type": "number",
              "description": "Maximum number of results"
            }
          },
          "required": ["query"]
        }
      }
    ]
  }
}

Error Response

If tool discovery fails (e.g., database unavailable):
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32603,
    "message": "Internal error discovering tools"
  }
}

Implementation Notes

  • Tools are converted from ToolDefinition DTOs to McpTool format
  • The inputSchema field maps to the parameters field from ToolDefinition
  • Parameter schemas follow OpenAI function calling conventions
  • Array parameters include an items field specifying element types
  • Required parameters are extracted from the ToolParameter.required flag

Source Code Reference

Implemented in:
org.dynamcorp.handsaiv2.controller.MCPController.discoverTools()
// Location: src/main/java/org/dynamcorp/handsaiv2/controller/MCPController.java:36

cURL Example

curl -X GET http://localhost:8080/mcp/tools/list \
  -H "Content-Type: application/json"

Build docs developers (and LLMs) love