apply_to_job
Submit a job application, create a tracker entry with APPLIED status, and optionally auto-generate a cover letter.
Instructions
Apply to a job — creates a job tracker entry with status APPLIED and optionally generates a cover letter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| candidate_id | No | User/candidate ID (optional, defaults to authenticated user) | |
| job_id | No | Job ID to apply to | |
| company | Yes | Company name | |
| position | Yes | Job title / position | |
| job_url | No | URL of the job posting (optional) | |
| job_description | No | Full job description text (optional) | |
| cover_letter | No | Cover letter text. If omitted, one will be auto-generated. | |
| resume_id | No | Resume ID to attach to this application (optional) |
Implementation Reference
- index.js:154-176 (registration)The tool 'apply_to_job' is registered in the WEEK2_TOOLS array with its name, description, and inputSchema definition.
const WEEK2_TOOLS = [ { name: 'apply_to_job', description: 'Submit a job application through Placed. Attaches the candidate\'s resume and optional cover letter, then tracks the application.', inputSchema: { type: 'object', properties: { candidate_id: { type: 'string', description: 'Candidate profile ID (use "me" for the authenticated user)', }, job_id: { type: 'string', description: 'Job listing ID to apply to', }, cover_letter: { type: 'string', description: 'Optional cover letter text. If omitted, a cover letter is auto-generated from the candidate profile.', }, }, required: ['candidate_id', 'job_id'], }, }, - index.js:158-175 (schema)Input schema for apply_to_job: requires candidate_id and job_id, optional cover_letter.
inputSchema: { type: 'object', properties: { candidate_id: { type: 'string', description: 'Candidate profile ID (use "me" for the authenticated user)', }, job_id: { type: 'string', description: 'Job listing ID to apply to', }, cover_letter: { type: 'string', description: 'Optional cover letter text. If omitted, a cover letter is auto-generated from the candidate profile.', }, }, required: ['candidate_id', 'job_id'], }, - index.js:275-305 (handler)The handler for tools/call: all tools (including apply_to_job) are proxied to the backend via callBackend(). If the backend is unreachable and the tool is a new tool, a 'not_implemented' stub response is returned.
async function handleToolsCall(id, params) { const toolName = params && params.name; try { const result = await callBackend({ jsonrpc: '2.0', id, method: 'tools/call', params }); send({ ...result, id }); } catch (err) { // If the backend is unreachable and this is a new tool, return a clear stub message if (NEW_TOOL_NAMES.has(toolName)) { send({ jsonrpc: '2.0', id, result: { content: [ { type: 'text', text: JSON.stringify({ status: 'not_implemented', tool: toolName, message: `The '${toolName}' tool is defined in the MCP layer but the backend handler is not yet deployed. Backend error: ${err.message}`, }, null, 2), }, ], isError: false, }, }); } else { send({ jsonrpc: '2.0', id, error: { code: -32000, message: err.message } }); } } }