ask_expert
Consult specialized experts (frontend, backend, or QA) to get targeted answers for technical questions within the Claude Team MCP collaborative environment.
Instructions
向特定专家咨询问题
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expert | Yes | 专家类型:frontend(前端专家)、backend(后端专家)、qa(QA专家) | |
| question | Yes | 要咨询的问题 |
Implementation Reference
- src/server.ts:141-159 (registration)Tool registration including name, description, and input schema for 'ask_expert' in the ListToolsRequestSchema handler{ name: 'ask_expert', description: '向特定专家咨询问题', inputSchema: { type: 'object', properties: { expert: { type: 'string', enum: expertEnumInfo.enum, description: expertEnumInfo.description, }, question: { type: 'string', description: '要咨询的问题', }, }, required: ['expert', 'question'], }, },
- src/server.ts:470-478 (handler)Handler implementation for 'ask_expert' tool in the CallToolRequestSchema switch statement, which retrieves expert config and calls orchestrator.askDynamicExpertcase 'ask_expert': { const { expert, question } = args as { expert: string; question: string }; // 从动态专家列表中获取配置 const expertConfig = allExperts[expert] ?? { name: '技术专家', role: '你是一位技术专家。', tier: 'balanced' as const }; const response = await orchestrator.askDynamicExpert(expertConfig.tier, expertConfig.role, question); return { content: [{ type: 'text', text: `**${expertConfig.name}** 回复:\n\n${response}` }], }; }
- src/server.ts:144-158 (schema)Input schema definition for the 'ask_expert' toolinputSchema: { type: 'object', properties: { expert: { type: 'string', enum: expertEnumInfo.enum, description: expertEnumInfo.description, }, question: { type: 'string', description: '要咨询的问题', }, }, required: ['expert', 'question'], },
- src/server.ts:47-62 (helper)Helper function getAllExperts that provides the expert configurations used by 'ask_expert' toolfunction getAllExperts(config: Config): Record<string, { name: string; role: string; tier: 'fast' | 'balanced' | 'powerful' }> { const experts = { ...BUILTIN_EXPERTS }; // 添加自定义专家 if (config.customExperts) { for (const [id, custom] of Object.entries(config.customExperts)) { experts[id] = { name: custom.name, role: custom.prompt, tier: custom.tier || 'balanced', }; } } return experts; }
- src/server.ts:26-42 (helper)BUILTIN_EXPERTS constant providing default expert roles used in 'ask_expert' toolconst BUILTIN_EXPERTS: Record<string, { name: string; role: string; tier: 'fast' | 'balanced' | 'powerful' }> = { frontend: { name: '前端专家', role: '你是一位资深前端工程师,精通 React、Vue、TypeScript、CSS 等前端技术。', tier: 'balanced' }, backend: { name: '后端专家', role: '你是一位资深后端工程师,精通 API 设计、数据库、Node.js、Python 等后端技术。', tier: 'powerful' }, qa: { name: 'QA专家', role: '你是一位资深 QA 工程师,擅长代码审查、测试、安全分析和 Bug 修复。', tier: 'balanced' }, };