Skip to main content
Glama

getCategories

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

Instructions

Get all categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that reads the database and returns all categories. This is the primary implementation logic for the getCategories tool.
    export const getCategories = async (): Promise<Category[]> => { await db.read() return db.data.categories }
  • Zod schema defining the structure of a Category, used for input/output validation in the getCategories tool (output: array of categories).
    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, providing schema and a thin wrapper handler that calls the core repository 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 }, } }, )

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