create_proposal
Generate professional proposals by specifying contact details, templates, and custom fields for business documentation.
Instructions
Create a new proposal
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_user_id | No | ||
| contact_id | Yes | ||
| contact_people | Yes | ||
| design_template_id | Yes | ||
| name | Yes | ||
| proposal_template_id | Yes | ||
| text_template_id | Yes | ||
| custom_fields | No |
Implementation Reference
- The main handler implementation for the 'create_proposal' tool, including the execute function that makes a POST request to '/proposals/' with the provided parameters, parses the response using createProposalSchema, and returns the stringified data.export const createProposalTool: Tool<typeof parameters._type, typeof parameters> = { name: 'create_proposal', description: 'Create a new proposal', parameters, annotations: { title: 'Create Proposal', openWorldHint: true, }, async execute(params) { const result = await post('/proposals/', params); const parsed = createProposalSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); }, };
- Input schema (parameters) defining the structure for the create_proposal tool inputs.const parameters = z.object({ account_user_id: z.number().optional(), contact_id: z.number(), contact_people: z.array(z.number()), design_template_id: z.number(), name: z.string(), proposal_template_id: z.number(), text_template_id: z.number(), custom_fields: z.array(z.object({ name: z.string(), value: z.string() })).optional(), // automations_set_id: z.number().optional(), // content: proposalContentSchema.optional(), // directory_id: z.number().optional(), // tags: z.array(z.union([z.string(), z.object({ id: z.number(), name: z.string() })])).optional(), });
- src/schemas/proposals.ts:72-75 (schema)Output schema used to validate the API response from creating a proposal.export const createProposalSchema = z.object({ id: z.number(), version_id: z.number(), });
- src/tools/register.ts:16-16 (registration)Import of the createProposalTool.import { createProposalTool } from './proposals/create-proposal.js';
- src/tools/register.ts:33-33 (registration)Addition of createProposalTool to the tools array for registration.createProposalTool,