Skip to main content
Glama

listKnowledgeBases

Access and retrieve a list of available knowledge bases using MCP-Smallest.ai's standardized interface, enabling efficient knowledge base management and integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:16-41 (handler)
    Handler function that executes the logic for listing knowledge bases by fetching from the configured API endpoint and returning the JSON response or error.
    async () => { try { const response = await fetch(`${config.BASE_URL}/knowledgebase`, { method: 'GET', headers: { 'Authorization': `Bearer ${config.API_KEY}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; console.error('Error fetching knowledge bases:', error); return { content: [{ type: "text", text: `Error: ${errorMessage}` }], isError: true }; } }
  • index.ts:14-42 (registration)
    Registration of the 'listKnowledgeBases' tool on the MCP server with no input parameters and the inline handler function.
    "listKnowledgeBases", {}, // Empty object for no parameters async () => { try { const response = await fetch(`${config.BASE_URL}/knowledgebase`, { method: 'GET', headers: { 'Authorization': `Bearer ${config.API_KEY}` } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; console.error('Error fetching knowledge bases:', error); return { content: [{ type: "text", text: `Error: ${errorMessage}` }], isError: true }; } } );
  • Empty schema indicating the tool takes no input parameters.
    {}, // Empty object for no parameters

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VinayakTiwari1103/MCP-smallest-ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server