Skip to main content
Glama

list-category-objects

Retrieve all objects within a specified category by providing its ID. This tool helps manage and access resources efficiently using the MCP Server for PI Dashboard integration.

Instructions

List all objects for a specific category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryIdYesCategory ID

Implementation Reference

  • Handler function for the 'list-category-objects' tool. Fetches category objects via authenticated API request and formats the response as text or handles errors.
    }, async ({ categoryId }) => { try { const categoryObjects = await authenticatedRequest(`/categories/${categoryId}/categoryObjects`); return { content: [{ type: "text", text: `Category objects retrieved successfully:\n${JSON.stringify(categoryObjects, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching category objects: ${getErrorMessage(error)}` }] }; }
  • Zod input schema defining the required 'categoryId' parameter as a number.
    categoryId: z.number().describe("Category ID")
  • build/index.js:741-759 (registration)
    Tool registration call using server.tool(), specifying name, description, input schema, and inline handler function.
    server.tool("list-category-objects", "List all objects for a specific category", { categoryId: z.number().describe("Category ID") }, async ({ categoryId }) => { try { const categoryObjects = await authenticatedRequest(`/categories/${categoryId}/categoryObjects`); return { content: [{ type: "text", text: `Category objects retrieved successfully:\n${JSON.stringify(categoryObjects, null, 2)}` }] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Error fetching category objects: ${getErrorMessage(error)}` }] }; } });

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/mingzilla/pi-api-mcp-server'

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