Skip to main content
Glama

getCategories

Retrieve all categories from the memo-mcp server to efficiently organize and access stored memos using the LowDB database.

Instructions

Get all categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for getCategories, which calls the repository getCategories and formats the response with content and structuredContent.
    async () => { const categories = await getCategories() return { content: [{ text: JSON.stringify(categories), type: "text" }], structuredContent: { categories }, } },
  • Zod schema definition for Category, used in the tool's outputSchema as z.array(CategorySchema). Input schema is empty object.
    export const CategorySchema = z.object({ createdAt: z.string().datetime(), id: z.string(), name: z.string().min(1), updatedAt: z.string().datetime(), })
  • Registers the getCategories tool with the MCP server, including description, schemas, title, and handler function.
    server.registerTool( "getCategories", { description: "Get all categories", inputSchema: {}, outputSchema: { categories: z.array(CategorySchema) }, title: "Get Categories", }, async () => { const categories = await getCategories() return { content: [{ text: JSON.stringify(categories), type: "text" }], structuredContent: { categories }, } }, )
  • Repository helper function that reads the database and returns all categories, called by the tool handler.
    export const getCategories = async (): Promise<Category[]> => { await db.read() return db.data.categories }

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/108yen/memo-mcp'

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