search_documentation
Search Renesas FSP documentation by query and category to find drivers, RTOS, middleware, or security details from the GitHub repository.
Instructions
Search FSP documentation from GitHub repository
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": "search_documentation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query for documentation | |
| category | No |
Implementation Reference
- src/handlers/documentation.ts:19-97 (handler)Main handler function that executes the search_documentation tool. Takes query and category arguments, matches against a module list loaded from fsp-modules.json, and returns formatted documentation links from the Renesas FSP GitHub repository and docs site.
export const documentationSearchHandler = async (args?: any) => { const query = args?.query || ''; const category = args?.category || 'all'; const repoBaseUrl = 'https://github.com/renesas/fsp'; const rawBaseUrl = 'https://raw.githubusercontent.com/renesas/fsp/master'; const docsBaseUrl = 'https://renesas.github.io/fsp'; // If query matches a known module, provide direct links const matchedModule = moduleList.find(m => m.toLowerCase() === query.toLowerCase() || m.toLowerCase().includes(query.toLowerCase()) ); const moduleLinks = matchedModule ? [ `⢠API header: ${repoBaseUrl}/tree/master/ra/fsp/inc/api/${matchedModule}.h`, `⢠Source: ${repoBaseUrl}/tree/master/ra/fsp/src/${matchedModule}`, `⢠Instance: ${repoBaseUrl}/tree/master/ra/fsp/inc/instances/${matchedModule}.h` ].join('\n') : ''; // Use general documentation site for category const docLink = `${docsBaseUrl}/modules.html`; return { content: [ { type: "text", text: ` ================================================================================ FSP DOCUMENTATION SEARCH RESULTS ================================================================================ Query: "${query}" Category: ${category.toUpperCase()} -------------------------------------------------------------------------------- ${matchedModule ? `DIRECT MODULE LINKS FOR "${matchedModule.toUpperCase()}": -------------------------------------------------------------------------------- ${moduleLinks} --------------------------------------------------------------------------------` : ''} SEARCH RESULTS: -------------------------------------------------------------------------------- š 1. FSP Architecture Overview Link: ${repoBaseUrl}/blob/master/README.md Docs: ${docsBaseUrl} Description: Main README file containing FSP architecture overview, supported platforms, and setup information. š 2. Supported Software Modules Link: ${repoBaseUrl}/blob/master/SUPPORTED_SOFTWARE.md Docs: ${docsBaseUrl}/modules.html Description: Complete list of software modules packaged with FSP including drivers, RTOS, and middleware. š 3. ${category.toUpperCase()} Documentation Link: ${repoBaseUrl}/blob/master${docLink} Docs: ${docLink} Description: Documentation for ${category} related components and APIs. -------------------------------------------------------------------------------- USE THE OFFICIAL RENESAS FSP RESOURCES: -------------------------------------------------------------------------------- ⢠Repository: ${repoBaseUrl} ⢠Documentation: ${docsBaseUrl} ⢠Module Examples: ${docLink} -------------------------------------------------------------------------------- AVAILABLE CATEGORIES: -------------------------------------------------------------------------------- ⢠all - General FSP documentation ⢠drivers - Peripheral driver guides and HAL API references ⢠rtos - RTOS integration (Azure RTOS/FreeRTOS) ⢠middleware - Communication and security middleware stacks ⢠security - Secure boot, cryptographic engine, TEE ================================================================================ ` } ] }; }; - src/index.ts:54-70 (schema)Input schema definition for the search_documentation tool, specifying 'query' (string) and 'category' (enum: drivers, rtos, middleware, security, all) parameters.
{ name: "search_documentation", description: "Search FSP documentation from GitHub repository", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query for documentation" }, category: { type: "string", enum: ["drivers", "rtos", "middleware", "security", "all"] } } } }, - src/index.ts:158-159 (registration)Registration of the search_documentation tool in the CallToolRequestSchema switch-case, dispatching to documentationSearchHandler(args).
case "search_documentation": return await documentationSearchHandler(args); - src/index.ts:32-146 (registration)Tool listing registration including search_documentation name, description, and inputSchema for the ListToolsRequestSchema handler.
tools: [ { name: "fsp_info", description: "Get FSP architecture information and details", inputSchema: { type: "object", properties: { target: { type: "string", description: "Target platform (RA6, RA8, R74C, etc.)" } } } }, { name: "fsp_version", description: "Get FSP version information and release notes", inputSchema: { type: "object", properties: {} } }, { name: "search_documentation", description: "Search FSP documentation from GitHub repository", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query for documentation" }, category: { type: "string", enum: ["drivers", "rtos", "middleware", "security", "all"] } } } }, { name: "find_code_examples", description: "Find code examples for specific FSP features or peripherals", inputSchema: { type: "object", properties: { feature: { type: "string", description: "Feature to find examples for (e.g., 'SPI', 'UART', 'secure_boot')" }, platform: { type: "string", description: "Target platform filter" } } } }, { name: "get_api_reference", description: "Get API reference documentation for FSP functions and structures", inputSchema: { type: "object", properties: { module: { type: "string", description: "Module name (e.g., 'FspLib', 'Spi', 'I2c')" }, function: { type: "string", description: "Specific function name" } } } }, { name: "manage_dependencies", description: "Manage FSP dependencies, versions, and compatibility matrix", inputSchema: { type: "object", properties: { action: { type: "string", enum: ["list", "check_compatibility", "get_versions"] }, platform: { type: "string", description: "Target MCU platform" } } } }, { name: "fsp_build_info", description: "Get FSP build-related information", inputSchema: { type: "object", properties: {} } }, { name: "fsp_config_info", description: "Get FSP configuration information", inputSchema: { type: "object", properties: {} } }, { name: "fsp_help", description: "Get help information for the FSP MCP server", inputSchema: { type: "object", properties: {} } } ] - src/handlers/documentation.ts:10-17 (helper)Helper code that loads the module list from fsp-modules.json file at startup, used by the handler to match queries against known modules.
const modulesPath = path.join(process.cwd(), 'src', 'fsp-modules.json'); let moduleList: string[] = []; try { const data = fs.readFileSync(modulesPath, 'utf8'); moduleList = JSON.parse(data).modules || []; } catch (e) { // ignore }