get_single_tag
Retrieve detailed information for a specific tag using its ID. First obtain tag IDs from get_all_tags.
Instructions
Get details of a single tag by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tagId | Yes | Id of the tag to query. Call get_all_tags first to discover ids. |
Implementation Reference
- src/tools/tags.ts:60-72 (handler)The tool handler function for 'get_single_tag'. It takes a tagId, makes a GET request to /tags/{tagId}, and returns the response data.
async ({ tagId }) => { try { const response = await api.get(`/tags/${tagId}`); if (!response.ok) { return handleApiError(response, "Failed to get tag"); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to get tag"); } }, - src/tools/tags.ts:47-58 (schema)Input schema for 'get_single_tag' defining the 'tagId' parameter as a coerced number with a description.
{ description: "Get details of a single tag by ID.", inputSchema: { tagId: z.coerce .number() .describe( "Id of the tag to query. Call get_all_tags first to discover ids.", ), }, annotations: { readOnlyHint: true, }, - src/tools/tags.ts:45-73 (registration)Registration of 'get_single_tag' tool via server.registerTool() with name 'get_single_tag'.
server.registerTool( "get_single_tag", { description: "Get details of a single tag by ID.", inputSchema: { tagId: z.coerce .number() .describe( "Id of the tag to query. Call get_all_tags first to discover ids.", ), }, annotations: { readOnlyHint: true, }, }, async ({ tagId }) => { try { const response = await api.get(`/tags/${tagId}`); if (!response.ok) { return handleApiError(response, "Failed to get tag"); } return dataResponse(await response.json()); } catch (error) { return catchError(error, "Failed to get tag"); } }, ); - src/index.ts:27-27 (registration)Call to registerTagTools(server) in the main entry point, which registers all tag tools including 'get_single_tag'.
registerTagTools(server); - src/tools/tags.ts:62-65 (helper)API call to GET /tags/{tagId} made via the api helper object defined in src/api.ts.
const response = await api.get(`/tags/${tagId}`); if (!response.ok) { return handleApiError(response, "Failed to get tag");