get_trial_details
Retrieve comprehensive clinical trial details including investigator information, study sites, contact methods, eligibility criteria, and outcome measures using NCT ID.
Instructions
获取指定临床试验的详细信息,包括:PI研究者信息、各地医院地点、联系方式(电话/邮箱)、详细研究介绍、入选/排除标准、结果指标等全面信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nctId | Yes | NCT编号,例如:NCT04852770 |
Implementation Reference
- src/index.js:82-95 (registration)Registration of the 'get_trial_details' tool in ListToolsRequestHandler, including name, description, and input schema.{ name: 'get_trial_details', description: '获取指定临床试验的详细信息,包括:PI研究者信息、各地医院地点、联系方式(电话/邮箱)、详细研究介绍、入选/排除标准、结果指标等全面信息', inputSchema: { type: 'object', properties: { nctId: { type: 'string', description: 'NCT编号,例如:NCT04852770', }, }, required: ['nctId'], }, },
- src/index.js:167-183 (handler)MCP CallToolRequest handler for 'get_trial_details': validates input, calls ClinicalTrialsClient.getTrialDetails, and returns formatted JSON response.case 'get_trial_details': { const { nctId } = args; if (!nctId) { throw new Error('NCT编号是必需的'); } const details = await clinicalTrialsClient.getTrialDetails(nctId); return { content: [ { type: 'text', text: JSON.stringify(details, null, 2), }, ], }; }
- src/clinical-trials-client.js:236-243 (handler)Core handler implementation in ClinicalTrialsClient: makes API request to fetch trial details by NCT ID and formats the response.async getTrialDetails(nctId) { try { const response = await this.axios.get(`/studies/${nctId}`); return this.formatTrialDetails(response.data); } catch (error) { throw this.handleError(error); } }
- Helper function to format raw API response into comprehensive structured trial details, extracting PI info, locations, contacts, eligibility criteria, outcomes, etc.formatTrialDetails(data) { const protocol = data.protocolSection || {}; const identification = protocol.identificationModule || {}; const status = protocol.statusModule || {}; const description = protocol.descriptionModule || {}; const conditions = protocol.conditionsModule || {}; const design = protocol.designModule || {}; const arms = protocol.armsInterventionsModule || {}; const outcomes = protocol.outcomesModule || {}; const eligibility = protocol.eligibilityModule || {}; const sponsor = protocol.sponsorCollaboratorsModule || {}; const contacts = protocol.contactsLocationsModule || {}; return { // === 基本信息 === nctId: identification.nctId, title: identification.briefTitle, officialTitle: identification.officialTitle, acronym: identification.acronym, status: status.overallStatus, whyStopped: status.whyStopped, // === 疾病和关键词 === conditions: conditions.conditions || [], keywords: conditions.keywords || [], // === 干预措施 === interventions: arms.interventions?.map(i => ({ type: i.type, name: i.name, description: i.description, otherNames: i.otherNames || [], })) || [], // === 研究设计 === studyType: design.studyType, phase: design.phases || [], designInfo: design.designInfo, enrollmentCount: design.enrollmentInfo?.count, enrollmentType: design.enrollmentInfo?.type, // === 时间信息 === startDate: status.startDateStruct?.date, primaryCompletionDate: status.primaryCompletionDateStruct?.date, completionDate: status.completionDateStruct?.date, lastUpdate: status.lastUpdatePostDateStruct?.date, studyFirstPostDate: status.studyFirstPostDateStruct?.date, // === 主办方和研究者 === leadSponsor: { name: sponsor.leadSponsor?.name, class: sponsor.leadSponsor?.class, }, collaborators: sponsor.collaborators?.map(c => ({ name: c.name, class: c.class, })) || [], responsibleParty: sponsor.responsibleParty, // === 研究者信息(PI等) === investigators: protocol.sponsorCollaboratorsModule?.investigators?.map(inv => ({ name: inv.name, role: inv.role, affiliation: inv.affiliation, })) || [], // === 描述信息 === briefSummary: description.briefSummary, detailedDescription: description.detailedDescription, // === 结果指标 === primaryOutcomes: outcomes.primaryOutcomes?.map(outcome => ({ measure: outcome.measure, description: outcome.description, timeFrame: outcome.timeFrame, })) || [], secondaryOutcomes: outcomes.secondaryOutcomes?.map(outcome => ({ measure: outcome.measure, description: outcome.description, timeFrame: outcome.timeFrame, })) || [], otherOutcomes: outcomes.otherOutcomes?.map(outcome => ({ measure: outcome.measure, description: outcome.description, timeFrame: outcome.timeFrame, })) || [], // === 入选/排除标准(详细) === eligibility: { eligibilityCriteria: eligibility.eligibilityCriteria, sex: eligibility.sex, genderBased: eligibility.genderBased, genderDescription: eligibility.genderDescription, minimumAge: eligibility.minimumAge, maximumAge: eligibility.maximumAge, stdAges: eligibility.stdAges || [], healthyVolunteers: eligibility.healthyVolunteers, }, // === 中心联系人(全局) === centralContacts: contacts.centralContacts?.map(contact => ({ name: contact.name, role: contact.role, phone: contact.phone, phoneExt: contact.phoneExt, email: contact.email, })) || [], overallOfficials: contacts.overallOfficials?.map(official => ({ name: official.name, affiliation: official.affiliation, role: official.role, })) || [], // === 研究地点(按城市/医院) === locations: contacts.locations?.map(loc => ({ facility: loc.facility, city: loc.city, state: loc.state, zip: loc.zip, country: loc.country, status: loc.status, coordinates: loc.geoPoint, // 地点联系人(PI、招募协调员等) contacts: loc.contacts?.map(contact => ({ name: contact.name, role: contact.role, phone: contact.phone, phoneExt: contact.phoneExt, email: contact.email, })) || [], })) || [], // === 研究地点统计 === locationsSummary: { totalLocations: contacts.locations?.length || 0, countries: [...new Set(contacts.locations?.map(l => l.country).filter(Boolean))] || [], cities: [...new Set(contacts.locations?.map(l => l.city).filter(Boolean))] || [], }, }; }