Find Project Member
find_project_memberSearch for users with access to a MantisBT project by name, display name, or email to identify team members and assign tasks.
Instructions
Search for users with access to a MantisBT project by name, display name, or email.
Returns up to limit matching users (default: 10, max: 100). Matching is case-insensitive substring search across name, real_name, and email fields. Omit query to list the first limit users.
Data is served from the local metadata cache when fresh; falls back to a live API call otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Numeric project ID | |
| query | No | Case-insensitive substring to match against name, real_name, or email | |
| limit | No | Maximum number of results to return (default: 10, max: 100) |
Implementation Reference
- src/tools/projects.ts:187-213 (handler)The handler logic for the 'find_project_member' tool, which fetches project users from cache or API and filters them based on the query.
async ({ project_id, query, limit }) => { try { let users: MantisUser[]; const cached = cache ? await cache.loadIfValid() : null; if (cached?.byProject[project_id]) { users = cached.byProject[project_id]!.users; } else { const result = await client.get<{ users: MantisUser[] }>(`projects/${project_id}/users`); users = result.users ?? []; } if (query) { const q = query.toLowerCase(); users = users.filter((u) => u.name.toLowerCase().includes(q) || (u.real_name?.toLowerCase().includes(q) ?? false) || (u.email?.toLowerCase().includes(q) ?? false) ); } return { content: [{ type: 'text', text: JSON.stringify(users.slice(0, limit), null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } ); - src/tools/projects.ts:167-186 (registration)Registration and schema definition for the 'find_project_member' tool.
server.registerTool( 'find_project_member', { title: 'Find Project Member', description: `Search for users with access to a MantisBT project by name, display name, or email. Returns up to \`limit\` matching users (default: 10, max: 100). Matching is case-insensitive substring search across \`name\`, \`real_name\`, and \`email\` fields. Omit \`query\` to list the first \`limit\` users. Data is served from the local metadata cache when fresh; falls back to a live API call otherwise.`, inputSchema: z.object({ project_id: z.coerce.number().int().positive().describe('Numeric project ID'), query: z.string().optional().describe('Case-insensitive substring to match against name, real_name, or email'), limit: z.coerce.number().int().min(1).max(100).default(10).describe('Maximum number of results to return (default: 10, max: 100)'), }), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, },