create_document
Generate and store a document in a specific vault by providing the project ID, vault ID, title, and HTML content using the Basecamp MCP Server tool.
Instructions
Create a document in a vault
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Document HTML content | |
| project_id | Yes | Project ID | |
| title | Yes | Document title | |
| vault_id | Yes | Vault ID |
Implementation Reference
- src/lib/basecamp-client.ts:337-350 (handler)Core handler function that executes the document creation logic by posting to the Basecamp API.async createDocument( projectId: string, vaultId: string, title: string, content: string, status = 'active' ): Promise<Document> { const response = await this.client.post(`/buckets/${projectId}/vaults/${vaultId}/documents.json`, { title, content, status, }); return response.data; }
- src/index.ts:422-431 (schema)Input schema for validating tool parameters in MCP tool calls.inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID' }, vault_id: { type: 'string', description: 'Vault ID' }, title: { type: 'string', description: 'Document title' }, content: { type: 'string', description: 'Document HTML content' }, }, required: ['project_id', 'vault_id', 'title', 'content'], },
- src/index.ts:420-432 (registration)Tool object registration in the MCP ListTools handler, defining name, description, and schema.name: 'create_document', description: 'Create a document in a vault', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID' }, vault_id: { type: 'string', description: 'Vault ID' }, title: { type: 'string', description: 'Document title' }, content: { type: 'string', description: 'Document HTML content' }, }, required: ['project_id', 'vault_id', 'title', 'content'], }, },
- src/index.ts:799-815 (handler)MCP CallToolRequest dispatch handler for create_document, invoking the client method and formatting the tool response.case 'create_document': { const document = await client.createDocument( typedArgs.project_id, typedArgs.vault_id, typedArgs.title, typedArgs.content ); return { content: [{ type: 'text', text: JSON.stringify({ status: 'success', document }, null, 2) }] }; }