Skip to main content

Sweepy MCP tool reference

The MCP server in server.py exposes twelve tools. The MCP integration page covers registration and common workflows. This page lists every signature, so you can predict what a call does before an assistant runs it.

Response payload​

Each tool returns a JSON string inside a text content block. Success payloads start with "status": "ok". Failure payloads start with "status": "error" and include a message that explains the cause. A failed sweep also reports job_id and sweep_status: "failed".

Behavior hints​

Sweepy declares four MCP annotations on every tool. A compatible host reads these hints before it invokes the tool.

HintMeaning
readOnlyHintThe call doesn't persist changes.
destructiveHintThe call can overwrite or delete files, profiles, or history.
idempotentHintRepeating the same call reaches the same end state.
openWorldHintThe call reaches beyond the local machine.
ToolRead-onlyDestructiveIdempotentOpen world
create_profileNoYesYesNo
run_sweepNoYesNoYes
get_sweep_statusNoNoYesNo
get_jobsNoNoYesNo
submit_judgmentsNoYesYesNo
import_jobsNoYesYesYes
render_reportNoYesYesNo
get_resultsYesNoYesNo
export_reportNoYesYesNo
clear_historyNoYesYesNo
convert_documentNoYesYesNo
convert_docxNoYesYesNo

Profile and sweep tools​

create_profile​

Validates each enabled engine, then writes the profile YAML file.

ParameterTypeDefaultDescription
namestringRequiredFull name written to the profile.
titlesstring arrayRequiredTarget job titles, such as ["Technical Writer", "UX Writer"].
locationstringRequiredTarget location, such as "New York, NY".
resume_pathstringRequiredPath to a PDF or DOCX resume.
remote_onlybooleanfalseRestricts results to 100% remote roles.
include_hybridbooleantrueKeeps hybrid roles in the results.
min_salaryinteger0Minimum annual base salary. Zero means no minimum.
must_have_skillsstring arraynullSkill terms that boost matching.
synonymsarray of arraysnullInterchangeable term groups, such as [["docs-as-code", "documentation as code"]].
platformsobjectnullPlatform switches merged into the profile's platforms block.
sources_configobjectnullEngine selection merged into the sources block. Every engine validates before the write.
cache_configobjectnullCache settings: enabled and ttl_seconds.
orchestrator_configobjectnullTimeout and circuit-breaker settings.
history_configobjectnullCross-run settings that control which postings the sweep skips.
job_trackingbooleantrueAdd the job-tracking columns to the CSV and carry earlier values forward.
assessmentstring"agent"Report gate. agent blocks a report while any card has keyword overlap alone. keyword permits keyword-only reports.
output_filenamestringnullCustom YAML path. Defaults to profiles/{name}_{title}.yaml. Sweepy lowercases both parts and replaces every non-alphanumeric character with _.

orchestrator_config takes timeout_per_source_seconds and a circuit_breaker object with failure_threshold and cooldown_seconds.

history_config takes enabled, retention_days, match, and path. retention_days defaults to 4, match accepts url or url+role, and path defaults to ~/.sweepy/history.db.

Returns profile_path, enabled_engines, and engines_not_enabled.

run_sweep​

Starts the five-stage pipeline and returns deterministic keyword-overlap scores. It doesn't invoke LLM judgment.

ParameterTypeDefaultDescription
profile_pathstringnullPath to the profile YAML. When omitted, Sweepy uses the last saved profile, then the first conventional profile on disk: profiles/custom_profile.yaml, profiles/paralegal_nyc.yaml, or config.sample.yaml.
deduplicatebooleantrueMerges repeated URLs and matching postings from different boards for this run.
include_seenbooleanfalseReports postings from earlier sweeps and refreshes their history.
wait_secondsinteger45Longest blocking wait before the call returns progress. Clamped to the range 0 to 600.

A live sweep often runs longer than a client timeout. The pipeline handles that gap by running on a background thread. A call that returns sweep_status: "running" includes a job_id. Pass that id to get_sweep_status until the status reads completed.

A second call with the same profile and flags attaches to the running job instead of starting another. The server process must stay running. Sweep job ids live in memory. A restart clears them.

Returns one of three payloads:

  • Running: sweep_status, job_id, progress with step, total, and label, plus elapsed_seconds, debug_log, and message.
  • Completed: sweep_status, job_id, discovered_count, new_count, previously_seen_count, active_count, top_match, top_roles, reports, job_ids, card_count, assessed_count, assessment_mode, assessment_required, skipped_sources, elapsed_seconds, debug_log, and message. top_roles holds the first five roles.
  • Failed: status: "error", message, job_id, and sweep_status: "failed".

A missing or unreadable profile path fails before a job starts. That error has no job_id.

When every discovered posting is a repeat, previously_seen_count reports the total and active_count reports zero. Call run_sweep with include_seen set to true to review them.

get_sweep_status​

Waits on a sweep that run_sweep started and reports its progress.

ParameterTypeDefaultDescription
job_idstringnullSweep id from run_sweep. Defaults to the most recent job.
wait_secondsinteger45Longest blocking wait before the call returns progress. Clamped to the range 0 to 600.

Each response returns the same fields as the matching run_sweep result. A missing or unknown job_id returns an error that points back to run_sweep.

A finished sweep also loads its cards into the live session, so get_jobs, submit_judgments, and render_report work once the status reads completed.

get_jobs​

Returns the card records held in the current session, ranked by keyword overlap or submitted match score.

ParameterTypeDefaultDescription
profile_stemstringnullProfile identifier used to load a saved session, such as pedro_writer.
results_dirstring"results"Folder that holds report_session.json.
limitintegernullNumber of cards to return. Omit it to return every card. Sweepy enforces a minimum of one.

Returns count and jobs. While a sweep runs, the payload adds sweep_status, running_job_id, progress, and a message that warns the cards predate that sweep.

submit_judgments​

Merges an assistant's assessment into one card or a whole batch. Only non-null fields change.

ParameterTypeDefaultDescription
job_idstringnullStable card id from run_sweep or get_jobs. Required unless you pass judgments.
match_pctintegernullMatch percentage from 0 to 100. Supplying it changes the card label to MATCH.
resume_trackstringnullResume track to display on the card.
resume_colorstringnullBadge color for that track.
domainstringnullRole domain shown on the card.
summarystringnullCard summary text.
requirementsstringnullRequirements text.
alignmentstringnullNote that connects the resume evidence to the role.
has_extended_responsebooleannullFlags a posting that requires written answers.
app_formatstringnullApp format, such as a portal or an email.
compstringnullCompensation line.
benefitsstringnullBenefits line.
page_themestringnullCard theme override.
judgmentsarraynullList of judgment objects, each with a job_id plus any field preceding. Don't combine it with job_id.

Returns the merged card as job. A batch returns applied, jobs, and rejected, where rejected names any entry whose id is missing from the session.

import_jobs​

Adds roles that independent research found and verified. Sweepy doesn't confirm them by default.

ParameterTypeDefaultDescription
jobs_jsonstringRequiredJSON array of card records.
validatebooleanfalseRuns each URL through the link checker before import.

Returns imported and skipped. A rate limit or bot-protection response counts as unverified, so it doesn't prove a posting is dead.

render_report​

Renders the cards PDF from the current session.

ParameterTypeDefaultDescription
profile_stemstringnullProfile identifier used to load a saved session.
results_dirstring"results"Folder for the default output and the saved session.
output_filenamestringnullExplicit PDF path. It must stay inside the workspace.
playbookstring""Plain-text strategy note. Sweepy escapes & and angle brackets, and it renders **bold** as bold. Newlines become line breaks. Sweepy saves the text with the session, so a later call without it reuses the saved text. An empty value with no saved text generates a deterministic playbook.

Returns pdf_report, pages, card_count, and playbook_saved.

Profiles default to report.assessment: "agent", which blocks the render while any card has only keyword overlap. The error lists unassessed_job_ids and unassessed_titles so the assistant knows what to judge. Set report.assessment: "keyword" to allow mixed reports, or SWEEPY_REQUIRE_JUDGMENTS=1 to apply the gate to every profile and to export_report.

Results and history tools​

get_results​

Reads the latest sweep JSON from disk. It never re-runs discovery or scoring.

ParameterTypeDefaultDescription
profile_stemstringnullProfile identifier that filters the result files. Omit it to read the newest result file.
results_dirstring"results"Folder that holds the result files.
limitinteger10Number of top roles to return. Clamped to the range 1 to 100.

Returns result_file, pdf_report, csv_report, total_roles, and top_roles. Each role contains title, company, location, match_score, match_kind, resume_track, domain, url, and playbook.

Scores labeled KEYWORD OVERLAP are deterministic first-pass values. Use get_jobs and submit_judgments before you present them as matches.

export_report​

Rebuilds report files from an existing sweep JSON.

ParameterTypeDefaultDescription
json_sourcestringnullPath to the sweep JSON. It takes priority over profile_stem.
profile_stemstringnullProfile identifier used to find the latest matching JSON.
results_dirstring"results"Folder that holds the result files.
formatsstring array["pdf"]Output formats: pdf, png, csv, or json.
candidate_namestring"Job Seeker"Name in the PDF header.
output_dirstringnullOutput folder. Defaults to the folder that contains the source JSON.
job_trackingbooleannullAdd the job-tracking columns to a CSV export. Leave unset to follow the profile's export.tracking setting.

Returns source_file, roles_exported, generated, and errors. The generated object holds pdf, pdf_pages, png, csv, csv_rows, and json when the request includes those formats. A PNG request renders the PDF first. JSON output writes {stem}_export.json, so it never overwrites the sweep file that feeds it.

clear_history​

Forgets reported postings so the next sweep can report them again.

ParameterTypeDefaultDescription
profile_pathstringnullPath to the profile YAML.
profile_stemstringnullProfile identifier, such as pedro_writer.

Returns scope, cleared, and remaining. Histories are per profile. Call the tool with neither parameter after a sweep to clear the profile that sweep used. That fallback reads state from the running server, so pass profile_path or profile_stem after a restart.

Document conversion tools​

convert_document​

Converts .docx, .doc, .txt, .md, or .pdf to PDF. A PDF source passes through unchanged. Legacy .doc files need Microsoft Word.

ParameterTypeDefaultDescription
document_pathstringRequiredPath to the file to convert.
pdf_pathstringnullOutput path. Defaults to the source folder.

Returns pdf_path and source_path.

convert_docx​

Converts a DOCX resume to PDF with python-docx and reportlab. When Microsoft Word is available, it falls back to docx2pdf.

ParameterTypeDefaultDescription
docx_pathstringRequiredPath to the .docx file.
pdf_pathstringnullOutput path. Defaults to the DOCX folder.

Returns pdf_path.

Write paths​

Tools that write keep their output inside the Sweepy folder. A target outside that folder fails until you set SWEEPY_ALLOW_EXTERNAL_WRITES to 1. Reads accept any path the process can open.