Skip to main content
Glama

Shodan Host Count

shodan_host_count
Read-onlyIdempotent

Count hosts matching with facet breakdown (free, this endpoint does not consume query credits). Returns the total match count plus optional facet aggregations (e.g. top countries, orgs, ports). Example: shodan_host_count({ query: "apache", facets: "country:10", _apiKey: "your-key" })

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "apache",
      "_apiKey": "your-shodan-api-key"
    },
    "name": "shodan_host_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesShodan search query, e.g. "apache" or "port:443 country:DE"
facetsNoComma-separated facets for aggregation, e.g. "country:10" or "org:5,port:5" (optional)
_apiKeyYesShodan API key (account.shodan.io; paid membership required)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "_apiKey": "your-shodan-api-key",
      +    "query": "apache"
      +  },
      +  {
      +    "_apiKey": "your-shodan-api-key",
      +    "facets": "country:10,org:5",
      +    "query": "port:443 country:DE"
      +  }
      +]
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered structurally. The description adds genuinely new behavioral facts: the endpoint is free and consumes no query credits, and it returns a total match count plus optional facet aggregations, which tells the agent what to expect back.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the action and the cost benefit, with no filler. The inline example call largely duplicates the schema's own examples array, which is the only real redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter read-only query endpoint with no output schema, the description covers what is returned (total count plus facet aggregations) and the cost model, which is what an agent needs before calling. Minor gaps such as result limits or pagination are not mentioned but are low-risk for a count-only tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents query, facets and _apiKey including the 'paid membership required' note. The description repeats the facet format ('country:10') and gives example calls, adding only mild reinforcement rather than new semantic meaning, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Count hosts matching <query> with facet breakdown'. This clearly differentiates a counting endpoint from a full-result search, though it never names the sibling shodan_host_search to make the contrast explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The clause 'free, this endpoint does not consume query credits' implicitly recommends this tool when you only need totals rather than full host records, which is useful usage context. However, there is no explicit when-to-use/when-not-to-use statement or named alternative, so the agent must infer the routing from cost hints alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.