get_job
Retrieve LinkedIn job details using job ID or URL, returning cleaned data in TOON format with optional local JSON saving.
Instructions
Get LinkedIn job details. Returns cleaned data in TOON format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | No | LinkedIn job ID | |
| url | No | LinkedIn job URL | |
| save_dir | No | Directory to save cleaned JSON data |
Implementation Reference
- src/index.ts:823-840 (handler)The primary handler function for the 'get_job' tool. It processes input arguments (jobId or url), fetches job data from the '/job' API endpoint, cleans the data using DataCleaners.cleanJob, and returns a formatted TOON-encoded response.private async getJob(args: Record<string, any>): Promise<CallToolResult> { const params: Record<string, any> = {}; if (args.jobId) params.jobId = args.jobId; if (args.url) params.url = args.url; if (!params.jobId && !params.url) { throw new Error('At least one of jobId or url is required'); } const data = await this.makeRequest('/job', params); const cleaned = DataCleaners.cleanJob(data.element); return this.formatResponse(cleaned, { saveDir: args.save_dir, toolName: 'get_job', }); }
- src/index.ts:378-390 (registration)The tool registration in the ListTools response, defining the name, description, and input schema for 'get_job'.{ name: 'get_job', description: 'Get LinkedIn job details. Returns cleaned data in TOON format.', inputSchema: { type: 'object', properties: { jobId: { type: 'string', description: 'LinkedIn job ID' }, url: { type: 'string', description: 'LinkedIn job URL' }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, }, required: [], }, } as Tool,
- src/index.ts:381-389 (schema)The input schema defining parameters for the 'get_job' tool: jobId, url, and optional save_dir.inputSchema: { type: 'object', properties: { jobId: { type: 'string', description: 'LinkedIn job ID' }, url: { type: 'string', description: 'LinkedIn job URL' }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, }, required: [], },
- src/index.ts:100-117 (helper)Helper function in DataCleaners that processes and structures raw job data from the API into a clean format used by the handler.cleanJob(raw: any): any { if (!raw) return null; return { id: raw.id, title: raw.title, linkedinUrl: raw.linkedinUrl || raw.url, state: raw.jobState, postedDate: raw.postedDate, location: raw.location?.linkedinText, company: raw.company?.name || raw.companyName, companyUrl: raw.company?.linkedinUrl || raw.companyLink, salary: raw.salary?.text || (raw.salary?.min && raw.salary?.max ? `${raw.salary.min}-${raw.salary.max} ${raw.salary.currency || ''}` : null), employmentType: raw.employmentType, workplaceType: raw.workplaceType, easyApply: raw.easyApply, description: raw.descriptionText, }; },