save_job_analysis
Save or update job analysis records by ID or URL to prevent duplicates and preserve omitted fields.
Instructions
Persist an analyzed job record. Upserts by id then by url (D10).
Resolution order:
idgiven -> that row is the target; unknown id -> error="not_found".No
id,urlgiven and matching an existing row -> that row is the target (upsert by URL, unchanged semantics from the prior JSON store, including "omitted optional argument preserves the previous value").Otherwise -> a brand new row.
title/companyare NEVER used to match an existing record (R3) — a user editing a title for clarity must not silently create a duplicate under an update path, and title text is never treated as an update key either way.
url and custom_title follow the same "explicit argument overwrites,
omission (None) preserves the previous value" rule as score/
recommendation/notes/jd_text — this is what lets a URL be supplied
later without disturbing the custom_title, and vice versa (SC-04). On a
brand new row, at least one of url/custom_title must resolve to a
non-None value, or the record has no way for a human to find it again
(R1, SC-03).
This tool NEVER raises — all failures are encoded in the return envelope.
Args:
title: Job title (Claude-extracted). Always required, always
overwrites — no omit-preserve semantics.
company: Company name (Claude-extracted). Same as title.
country: Free-text country (Claude-extracted). Same as title.
id: Existing job id to update. None to create or
upsert-by-url.
url: Job posting URL. Nullable/unique attribute, not the
identity (D1). Omitted (None) preserves the
existing value on an update.
custom_title: User-supplied handle when url is absent. Same
omit-preserve rule as url.
jd_text: Full pasted job description, stored in the
job_descriptions side table. Omitted (None)
leaves any existing captured JD untouched.
score: 0-100 match score (Claude-supplied). Omit-preserve.
recommendation: APPLY/CONSIDER/SKIP (Claude-supplied). Omit-preserve.
notes: Free-text notes. Omit-preserve.
Returns: SaveJobResult with success=True, id, url, custom_title, updated flag on success; success=False with error/message on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| url | No | ||
| notes | No | ||
| score | No | ||
| title | Yes | ||
| company | Yes | ||
| country | Yes | ||
| jd_text | No | ||
| custom_title | No | ||
| recommendation | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| url | No | ||
| error | No | ||
| message | No | ||
| success | Yes | ||
| updated | No | ||
| custom_title | No | ||
| possible_duplicate_id | No |