-
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
Add a smart documentation tool that retrieves relevant Mapbox documentation based on the user's current context (what they're working on, code snippets, error messages).
Motivation
Going beyond simple search, contextual documentation helps AI assistants:
- Understand what the user is trying to accomplish
- Provide relevant documentation without explicit queries
- Help debug issues by matching error patterns
- Suggest related documentation proactively
Proposed Implementation
Create a new tool: get_contextual_docs_tool
Input Schema:
context(string, required) - Description of what user is working oncodeSnippet(string, optional) - Relevant code being worked witherrorMessage(string, optional) - Error message to help diagnosetechnology(string, optional) - Specific SDK/API being used
Output:
- Ranked list of relevant documentation sections
- Suggested next steps or related topics
- Links to full documentation
Implementation approach:
- Leverage search functionality from Add Documentation Search Tool for AI-powered doc discovery #68
- Parse context and extract key concepts
- Match against documentation corpus
- Rank by relevance to context
- Include related/suggested topics
Example usage:
{
"context": "trying to add custom markers with popups to a map",
"codeSnippet": "map.addLayer({type: 'symbol', ...})",
"technology": "mapbox-gl-js"
}Returns: Marker API docs, popup examples, addLayer reference, related patterns
Acceptance Criteria
-
get_contextual_docs_toolimplemented - Context parsing and keyword extraction
- Integration with search functionality
- Relevance ranking algorithm
- Tests (unit and integration)
- Updates CHANGELOG.md
- Documentation in README.md
Related
Part of enhanced documentation discovery initiative
Depends on: #68 (Documentation Search Tool)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request