get_opportunity_details
Retrieve comprehensive details for specific Australian Government ICT procurement opportunities, including contract information and procurement channels, by providing the opportunity ID and source table.
Instructions
Get detailed information about a specific opportunity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| opportunity_id | Yes | The sys_id of the opportunity | |
| table | Yes | The source table name (e.g., u_pcs_procurement, u_smp_procurement) |
Implementation Reference
- src/servicenow-client.ts:160-174 (handler)The core handler function that executes the tool logic by fetching opportunity details from the ServiceNow API using the specified table and opportunity ID.async getOpportunityDetails( opportunityId: string, table: string ): Promise<OpportunityDetails | null> { try { const response = await this.client.get( `/api/now/table/${table}/${opportunityId}` ); return response.data.result; } catch (error) { console.error('Error fetching opportunity details:', error); return null; } }
- src/index.ts:84-101 (registration)Registers the 'get_opportunity_details' tool in the TOOLS array, including name, description, and input schema for MCP.{ name: 'get_opportunity_details', description: 'Get detailed information about a specific opportunity', inputSchema: { type: 'object', properties: { opportunity_id: { type: 'string', description: 'The sys_id of the opportunity' }, table: { type: 'string', description: 'The source table name (e.g., u_pcs_procurement, u_smp_procurement)' } }, required: ['opportunity_id', 'table'] } },
- src/index.ts:152-180 (handler)MCP server request handler that processes 'get_opportunity_details' tool calls, validates arguments, invokes the client method, and formats the response.case 'get_opportunity_details': { const { opportunity_id, table } = args as { opportunity_id: string; table: string; }; const details = await snClient.getOpportunityDetails(opportunity_id, table); if (!details) { return { content: [ { type: 'text', text: `Opportunity not found: ${opportunity_id} in table ${table}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(details, null, 2), }, ], }; }
- src/types.ts:59-65 (schema)TypeScript interface defining the expected structure of the opportunity details returned by the tool.export interface OpportunityDetails extends OpportunityItem { description?: string; requirements?: string; contact_name?: string; contact_email?: string; [key: string]: any; }