get_contact_details
Retrieve comprehensive contact information from Offorte Proposal Software using a contact ID to access details for proposal management.
Instructions
Get all details for a contact by id
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_id | Yes |
Implementation Reference
- Handler function that fetches contact details from the API endpoint `/contacts/${contact_id}`, validates the response using contactDetailsSchema, throws error if invalid, and returns the JSON stringified data.async execute({ contact_id }) { const result = await get(`/contacts/${contact_id}`); const parsed = contactDetailsSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); },
- Input schema (parameters) for the get_contact_details tool, defining 'contact_id' as a required string.const parameters = z.object({ contact_id: z.string(), });
- src/schemas/contacts.ts:99-110 (schema)Output/response validation schema for contact details, used in the handler to parse API response. Includes fields like id, address, social, contacts, organisation fields, people, proposals, tags.export const contactDetailsSchema = z .object({ id: z.number(), ...addressFields, ...socialFields, ...contactFields, ...organisationFields, people: z.array(personSchema).optional(), proposals: proposalsListSchema.optional(), tags: tagsSchema.optional(), }) .passthrough();
- src/tools/register.ts:10-10 (registration)Import statement bringing in the getContactDetailsTool for registration.import { getContactDetailsTool } from './contacts/get-contact-details.js';
- src/tools/register.ts:23-23 (registration)The tool is added to the 'tools' array, which is later registered via server.addTool in registerTools function.getContactDetailsTool,