httpbin_json
Test and validate JSON responses from HTTP requests in the MCP Server Playground for development and debugging purposes.
Instructions
Returns data about slide show
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "httpbin_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | No |
Implementation Reference
- src/index.ts:59-81 (handler)Handler implementation for the 'httpbin_json' tool. Fetches JSON data from 'https://httpbin.org/json' using GET request and returns the parsed data as toolResult.
if (request.params.name === "httpbin_json") { try { const response = await fetch('https://httpbin.org/json', { method: 'GET', headers: { 'accept': 'application/json' } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return { toolResult: data }; } catch (error) { throw new Error("Something went wrong"); } } - src/index.ts:36-46 (registration)Tool registration in the ListTools response, defining name, description, and input schema for 'httpbin_json'.
{ name: "httpbin_json", description: "Returns data about slide show ", inputSchema: { type: "object", properties: { a: { type: "number" }, }, required: [] } } - src/index.ts:39-45 (schema)Input schema definition for the 'httpbin_json' tool, specifying an optional 'a' property of type number.
inputSchema: { type: "object", properties: { a: { type: "number" }, }, required: [] }