-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Context
Create a tool that fetches and provides working code examples from Mapbox documentation and examples repository, making it easy for AI assistants to provide copy-paste ready code.
Motivation
Code examples are one of the most valuable resources for developers. This tool helps AI assistants:
- Provide working, tested code snippets
- Show real-world usage patterns
- Help users get started quickly
- Demonstrate best practices from official examples
Proposed Implementation
Create a new tool: get_mapbox_example_tool
Input Schema:
topic(string, required) - Example topic: "3d-buildings", "custom-markers", "data-driven-styling", etc.sdk(string, optional) - Target SDK: "mapbox-gl-js", "ios", "android", etc.language(string, optional) - Programming language: "javascript", "swift", "kotlin", etc.
Output:
- Working code example
- Description of what it demonstrates
- Link to live demo (if available)
- Required dependencies
- Setup instructions
Implementation approach:
- Create index of Mapbox examples from:
- docs.mapbox.com examples
- github.com/mapbox/mapbox-gl-js/examples
- Other official example repositories
- Categorize by topic, SDK, use case
- Provide search/retrieval interface
- Include metadata for each example
Example usage:
{
"topic": "custom-markers",
"sdk": "mapbox-gl-js"
}Returns:
{
"title": "Add custom markers",
"description": "Add custom marker images to a map",
"code": "const map = new mapbox.Map({...});\nmap.loadImage('marker.png', (error, image) => {...});",
"liveDemo": "https://docs.mapbox.com/mapbox-gl-js/example/custom-markers/",
"dependencies": ["mapbox-gl"],
"tags": ["markers", "images", "symbols"]
}Acceptance Criteria
-
get_mapbox_example_toolimplemented - Index of Mapbox examples created
- Searchable by topic, SDK, language
- Returns working code with context
- Tests (unit and integration)
- Updates CHANGELOG.md
- Documentation in README.md
Example Sources
- https://docs.mapbox.com/mapbox-gl-js/example/
- https://docs.mapbox.com/ios/maps/examples/
- https://docs.mapbox.com/android/maps/examples/
- GitHub repositories (mapbox-gl-js, mapbox-gl-native, etc.)
Related
Part of enhanced documentation discovery initiative
Depends on: None (can be done in parallel)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request