Skip to main content
Glama

add_monitor

Add a user as a monitor to receive email notifications for MantisBT issue updates, ensuring they stay informed about changes.

Instructions

Add a user as a monitor (watcher) of a MantisBT issue. Monitors receive email notifications for issue updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_idYesNumeric issue ID
usernameYesUsername of the user to add as monitor

Implementation Reference

  • The handler implementation for the 'add_monitor' tool.
    async ({ issue_id, username }) => {
      try {
        const body = { name: username };
        const result = await client.post<unknown>(`issues/${issue_id}/monitors`, body);
        return {
          content: [{ type: 'text', text: JSON.stringify(result ?? { success: true }, null, 2) }],
        };
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
      }
    }
  • The input schema for the 'add_monitor' tool using Zod.
    inputSchema: z.object({
      issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'),
      username: z.string().min(1).describe('Username of the user to add as monitor'),
    }),
  • Registration of the 'add_monitor' tool within the MCP server.
    server.registerTool(
      'add_monitor',
      {
        title: 'Add Issue Monitor',
        description: 'Add a user as a monitor (watcher) of a MantisBT issue. Monitors receive email notifications for issue updates.',
        inputSchema: z.object({
          issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'),
          username: z.string().min(1).describe('Username of the user to add as monitor'),
        }),
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
        },
      },
      async ({ issue_id, username }) => {
        try {
          const body = { name: username };
          const result = await client.post<unknown>(`issues/${issue_id}/monitors`, body);
          return {
            content: [{ type: 'text', text: JSON.stringify(result ?? { success: true }, null, 2) }],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: 'text', text: errorText(msg) }], isError: true };
        }
      }
    );

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/dpesch/mantisbt-mcp-server'

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