queryApi
Query the Mallory cybersecurity-intelligence API. Two input fields:
"path": an endpoint under /v1/ (e.g. "/v1/vulnerabilities", "/v1/actors/APT29/attack_patterns"). You can ALSO paste a Mallory web URL or path here (e.g. "https://app.mallory.ai/vulnerabilities/CVE-2025-43300", "/actors/{uuid}", "/attack-patterns/T1566", "/references/{uuid}") — it's auto-translated to the matching API endpoint, so you never need to know the URL→API mapping.
"queryParams": object of string key->value pairs for filtering, sorting, pagination
PREFER the named per-entity tools when they fit: get to fetch one by id (e.g. getVulnerability, getThreatActor, getMalware, getObservable) and list to filter many (e.g. listVulnerabilities, listThreatActors). Use THIS tool as the fallback for what they don't express: relationship pivots (e.g. /v1/actors/APT29/malware), cross-entity search (/v1/search), structured field filters and numeric/date ranges, or any endpoint they don't cover. You can also paste a Mallory web URL as the path.
DATA DOMAINS (first path segment): vulnerabilities, actors (threat actors), malware, exploits, exploitations, breaches, attack_patterns (MITRE ATT&CK), products, organizations, observables, references, stories, advisories, detections, weaknesses (CWE), industries, packages, opinions, mentions, search.
Matched-organization breaches (/v1/breaches): Set queryParams.matched_asset_count__gt="0" to select breaches linked to visible organizations with current positive asset matches for the requesting tenant. Match age is irrelevant; use created_at__gte for newly recorded breaches. Supported breach matched_asset_count operators are exact, __gt, __gte, __lt, and __lte only. All count filters must hold for a single linked organization's match row. An exact zero requires an explicit zero-count row. Association does not establish victim status: verify that a matched organization is the victim before creating a finding. Do not replace this with monitoring newly created asset-match rows.
Distribution packages (/v1/distro-packages): Use this catalog for native operating-system packages; /v1/packages is the software-package catalog. Vulnerability evidence defaults to scope=all, which includes global and current-tenant assertions. Use scope=tenant for tenant-only assertions and scope=global for global-only assertions. Filter by exact distribution, release, kind, and case-sensitive name. Read /v1/distro-packages/{uuid} for package details and /v1/distro-packages/{uuid}/builds for its builds, optionally filtering by exact, case-sensitive architecture. Read /v1/distro-package-builds/{uuid} for one build. Read /v1/distro-packages/{uuid}/vulnerabilities for current publisher vulnerability assertions, or /v1/distro-package-builds/{uuid}/vulnerabilities for package assertions and exact evidence for that build. Preserve the requested scope and paginate with limit and offset. These reads retain vendor status, native scope, fix versions, and provenance. They do not establish tenant asset exposure; missing evidence and a fixed version without an affected range do not prove an older build is safe. Core enforces the distro_packages feature gate; a 404 does not establish that a package is absent.
COMMON PATTERNS: List + filter: path="/v1/vulnerabilities" queryParams={"filter":"cve:CVE-2024","sort":"cvss_base_score","order":"desc","limit":"10"} Relationships: path="/v1/actors/APT29/malware" | path="/v1/vulnerabilities/CVE-2024-1234/threat_actors" Cross-entity: path="/v1/search" queryParams={"q":"ransomware","types":"threat_actor,malware","limit":"10"} Compromised pkgs: path="/v1/packages" queryParams={"sort":"last_compromised_at","order":"desc","limit":"20"} — recently compromised packages, newest first (use sort=compromise_evidence_count for most-compromised by count). Drill in via path="/v1/packages/{uuid}/compromises" (sorts by reported_at desc; optional compromise_type: malicious_version, account_takeover, typosquat, dependency_confusion, backdoor, supply_chain, other).
FILTER PREFIXES (inside the "filter" param; which apply depends on the endpoint): cve:, uuid:, name:, desc:, gen_name:, gen_description:, mitre_id:, tactic:, loss_type:, record_type:. No prefix = default text/name search.
FIELD OPERATORS (append to a field name with "__"): strings: __neq, __in, __not_in, __like, __ilike (case-insensitive) numbers: __neq, __gt, __gte, __lt, __lte e.g. {"cvss_base_score__gte":"9"} timestamps: __gte, __lt with ISO-8601 values e.g. {"published_at__gte":"2024-01-01"}
CVSS Vector filtering (/v1/vulnerabilities)
CVSS vector filters: cvss=AV:A/PR:N matches all slash-separated tokens within one stored assessment; cvss__in=AV:A,AV:N matches any comma-separated fragment. Both search across CVSS 2.0, 3.0, 3.1, and 4.0 assessments; prefix a fragment with CVSS:3.1/ to restrict its version. Metric names and values are case-sensitive (v2 Au differs from v4 AU), and only explicitly stored metrics match. These filters do not change the selected numeric cvss_base_score. CVSS CEL: where='cvss == "AV:A/PR:N" && epss_score >= 0.5' supports ==, !=, in, AND/OR/NOT. Keep tokens in one fragment for same-assessment AND; separate CVSS comparisons may match different assessments. Invalid fragments return HTTP 400: correct the requested filter, never retry without it.
HUNTING: Actor/malware indicator_context summarizes global plus current-tenant intelligence for the resolved observable, not an actor-specific edge; tags/roles honor requested scope. Missing context and dates/roles remain unknown. source_count does not count independent investigations. Correct a rejected filter without dropping the user's selection. Array-typed queryParams accept CSV except /v1/observables tag, whose commas are literal; repeat inline tag parameters for multiple exact values. Repeated inline array parameters retain all values.
PAGINATION/SORT: "limit" (follow the endpoint's documented bound), "offset", "sort":"", "order":"asc"|"desc".
RESPONSE: results come back as {"data": , "meta": {"endpoint","path"}}. For list / search / relationship endpoints "data" is the list envelope {"data":[...items], "total", "offset", "limit"} (items live at data.data); for a single-entity path "data" is the entity object. List responses are returned whole, exactly as the API paged them — control size with limit/offset. Semantic entity queries return an exact integer total, but descending similarity pages without a cutoff are approximate; a 503 means semantic search is temporarily unavailable (a provider failure or a very broad query timing out), never that nothing matched. Invalid, blocked, or unknown paths return a tool error (isError), not a result.
Repository data availability: An empty resolved inventory, current=null, or an unavailable inventory tool does not mean the tenant has no repositories or vulnerabilities. Check connected integrations and whether they cover the requested data. If resolved inventory lacks that coverage and an authorized integration-data transport is available, continue with connected-source data: in the in-app sandbox, load the steampipe-querying skill, discover tables for the connected provider, and use its structured query workflow (cache first; live when uncached or current state is required). Preserve existing filters and repository scope, and report source freshness and coverage differences. If this client has no such transport or no relevant integration is connected, state the coverage limitation; never substitute global threat intel for tenant evidence. Do not bypass permission denials. Offer Mallory asset-page links only when that UI is enabled for the caller; otherwise use a source-provided repository URL when available.
Note: schedule management (/v1/schedules) is not exposed over MCP in V1. Every other endpoint is scoped by your API key to your own tenant.
Resolved assets, packages, and vulnerabilities: Start with GET /v1/assets. The inventory accepts where (CEL), sort, limit, and cursor. Select hosts with where='class == "host"' and repositories with where='class == "code_repository"'. Other classes include image, datastore, deployment, domain, organization, and network_service. A network_service is one host:port/transport context an external scanner reached at one dialed address (details.via); filter it on details.address, details.port, details.protocol, details.via, details.hosting_operator, details.scope_class, details.application_group_id (one id per service name, across the addresses it resolves to) or details.response_group_id (services whose root response matched, across names). Class-specific fields are under details: for example where='class == "code_repository" && details.is_archived == false && details.primary_language == "TypeScript"'. When the evidence establishes the subject class, include it in name searches and confirm the returned asset matches before linking a finding; a unique name match from another class is not sufficient. Use display_name.contains("acme") for name search, source == "github" for a connector slug, tags["environment"] == "production" for source tags, and mallory_tags == "critical" for operator tags. Do not send old hostname, q, language, visibility or tag parameters to the unified inventory. Get the supported details fields from its where metadata; correct rejected filters without dropping the user's selection.
Resolve an identity with GET /v1/assets/by-identifier queryParams={"type":"repo_url","value":"https://github.com/owner/repo","class":"code_repository"}. The optional class also scopes host identifiers such as serial_number or fqdn. This unpaginated lookup returns items with canonical asset_uuid values. Count distinct asset_uuid values; multiple identifier rows can name one merged asset. Never choose arbitrarily among multiple assets. GET /v1/assets/{asset_uuid} follows merged UUIDs and returns requested_uuid, merged_from, current and source_records. current=null means no current source record. Use canonical links /environment/{asset_uuid}. Repository details.is_public describes repository visibility; it is not a host exposure verdict.
Read installed products at /v1/assets/{asset_uuid}/products, package dependencies at /packages, and reported vulnerabilities (including ingested Dependabot alerts) at /vulnerabilities. These are tenant observations, distinct from the global /v1/packages compromise catalog and Mallory /v1/findings. Vulnerability filters include status=open|resolved|unknown and severity (both repeatable), cvss_min (0–10), epss_min (probability 0–1), and kev=true|false. Missing or zero product/package UUIDs mean unresolved identity, not absence.
Inventory, current instances and reverse lists return {items,total,limit,next_cursor}; in the tool wrapper read data.items and data.next_cursor. Follow next_cursor with unchanged filters and sort until null. If an in-app page exceeds the response size limit, retry with a smaller limit and the same cursor and filters; no rows were returned, so do not advance the cursor. /products/history, /packages/history and /vulnerabilities/history return {asset_uuid,days,items,truncated}, oldest first; respect the retention-capped days and truncated flag. History is not cursor-paginated. GET /v1/assets/link-overrides reads link decisions; this tool cannot change them.
GET /v1/assets/groups counts current assets per value of one field: group_by is a shared column or a scalar details path (details.response_group_id, details.application_group_id, details.hosting_operator, details.port), with the same where as the inventory. List a group's members with GET /v1/assets and the where extended by <group_by> == (== null for the null key). Scanner issues on an asset are at /v1/assets/{asset_uuid}/issues (status, severity, scanner, name filters) and /issues/history; status resolved is the source's own status; an instance its scanner stops reporting leaves /issues and shows in /issues/history as absent, which is not proof of a fix. GET /v1/assets/{asset_uuid}/organizations lists the organizations that make the asset's products or host it.
Reverse lookups use GET /v1/assets/vulnerabilities/{vulnerability_uuid}/assets, /v1/assets/products/{technology_product_uuid}/assets, /v1/assets/packages/{software_package_uuid}/assets, or /v1/assets/issues/{issue_uuid}/assets. Pass class=host or class=code_repository when required; omit class for all classes. Product/package lookups also accept configuration_uuid. Use resolved UUIDs, never a CVE or package name in a UUID slot.
Timelines use /v1/assets/vulnerabilities/{vulnerability_uuid}/timeline, /v1/assets/products/{technology_product_uuid}/timeline, or /v1/assets/packages/{software_package_uuid}/timeline. Pass resolution_scope=code_repository for repositories, host for hosts, or all for every scope. Use group_by=resolution_scope for class series. Environment-tag groups can overlap: use an ungrouped series for totals. Read affected_assets for the selected scope; affected_hosts counts hosts only. Combine series only when their returned days and inclusive UTC window_end agree. An empty page or timeline does not prove complete environment coverage. A 403/404/503 is an access, identity or availability failure, not an empty inventory.
Prefer listAssets for the asset inventory list and getAsset for one asset's detail; use this tool for asset sub-resources.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "queryApi"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | An endpoint path under /v1/ (e.g. /v1/vulnerabilities, /v1/actors/APT29/attack_patterns), OR a Mallory web URL/path you can paste directly (e.g. https://app.mallory.ai/vulnerabilities/CVE-2025-43300, /actors/{uuid}, /attack-patterns/T1566, /references/{uuid}) — pasted links are auto-translated to the matching API endpoint. | |
| queryParams | No | Query parameters for filtering, sorting, and pagination. Pass as {"key":"value"} pairs, e.g. {"filter":"cve:CVE-2024","limit":"10","sort":"cvss_base_score"}. For array parameters, use comma-separated values here (e.g. {"types":"vulnerability,exploit"}), except /v1/observables tag: commas stay literal, and multiple tags require repeated inline tag keys. Explicit values replace all inline values for that key. Pass {} if no params needed. |