feat: Add test API request tool with code generation#77
Open
mattpodwysocki wants to merge 1 commit intofeature/api-endpoint-explorerfrom
Open
feat: Add test API request tool with code generation#77mattpodwysocki wants to merge 1 commit intofeature/api-endpoint-explorerfrom
mattpodwysocki wants to merge 1 commit intofeature/api-endpoint-explorerfrom
Conversation
Implements test_api_request_tool to execute actual Mapbox API requests and generate copy-paste ready code examples. Features: - Makes real HTTP calls to Mapbox APIs - Returns actual responses with status codes and headers - Generates code snippets in curl, JavaScript, and Python - Shows execution timing and rate limit information - Masks access tokens in generated code for security - Supports all HTTP methods (GET, POST, PUT, PATCH, DELETE) - Handles path, query, and body parameters Complements explore_mapbox_api_tool (discover APIs) and validate_api_request_tool (validate requests) for a complete API development workflow: explore → validate → test. Addresses: #72 Changes: - Add TestApiRequestTool implementation - Register in toolRegistry.ts - Add comprehensive test coverage - Update CHANGELOG.md with feature details - Update README.md with tool documentation and examples Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
test_api_request_toolto execute actual Mapbox API requests and generate copy-paste ready code examples.This PR targets
feature/api-endpoint-explorer(PR #75) and depends on the endpoint definitions from that branch.Features
Use Cases
Complete API Workflow
This tool completes the API development trio:
Implementation
MapboxApiBasedToolwith proper lifecycleMAPBOX_API_ENDPOINTS(PR feat: Add API endpoint explorer tool #75)Testing
Example Usage
Input:
{ "api": "geocoding", "operation": "forward-geocode", "parameters": { "path": { "mode": "mapbox.places", "query": "San Francisco" } }, "generateCode": true, "codeLanguages": ["curl", "javascript", "python"] }Output:
Example Prompts
Documentation
Dependencies
MAPBOX_API_ENDPOINTSdefinitionsfeature/api-endpoint-explorerbranchAddresses
Closes #72
🤖 Generated with Claude Code