Get a model by id
getModelRetrieve a specific model definition by providing its unique ID.
Instructions
Fetch a single model definition by id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelId | Yes |
Implementation Reference
- src/tools.ts:318-326 (handler)The handler function for the 'getModel' tool. It registers the tool with name 'getModel', expects a 'modelId' string as input, and makes a GET request to /api/public/models/{modelId}.
server.registerTool( "getModel", { title: "Get a model by id", description: "Fetch a single model definition by id.", inputSchema: { modelId: z.string().min(1) }, }, async ({ modelId }) => asJson(await client.get(`/api/public/models/${enc(modelId)}`)), ); - src/tools.ts:323-323 (schema)Input schema for getModel: requires a non-empty string 'modelId' validated by Zod.
inputSchema: { modelId: z.string().min(1) }, - src/tools.ts:318-326 (registration)Registration of the 'getModel' tool via server.registerTool inside the registerTools function.
server.registerTool( "getModel", { title: "Get a model by id", description: "Fetch a single model definition by id.", inputSchema: { modelId: z.string().min(1) }, }, async ({ modelId }) => asJson(await client.get(`/api/public/models/${enc(modelId)}`)), ); - src/tools.ts:414-420 (registration)The tool name 'getModel' is also listed in the exported TOOL_NAMES constant array.
"getModel", "listProjects", "listComments", "getComment", "getMedia", "getHealth", ] as const; - src/tools.ts:6-8 (helper)Helper function 'asJson' used by the handler to wrap the API response into the MCP content format.
const asJson = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], });