Skip to main content
Glama

port_check

Read-only

Open a TCP connection to one or more ports on a host and report each as open, closed or filtered with the time the attempt took. Pass a single port or a list of up to 10; a single-port call also gets its answer flat, exactly as before the list form existed. partial=true means not every requested port was answered inside the time budget. TCP only -- there is no UDP check -- and filtered means no answer arrived, not that the port is certainly closed. Anonymous and rate-limited per IP; the host is resolved first and private or reserved addresses are refused, including a host whose DNS answer points into them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesDomain name or host
portYesTCP port, or a list of up to 10 ports, e.g. 443 or [80, 443, 25]

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipNo
okNo
hostNo
portNo
stateNo
timeMsNo
partialNo
resultsNo
portsRequestedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changed
    • removedOutput schema / properties / host / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / host / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / ip / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / ip / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / ok / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / ok / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / partial / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / partial / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / port / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / port / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / portsRequested / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / portsRequested / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • changedOutput schema / properties / results / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": {},
      -      "properties": {
      -        "error": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "ip": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "port": {
      -          "anyOf": [
      -            {
      -              "type": "number"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "state": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "timeMs": {
      -          "anyOf": [
      -            {
      -              "type": "number"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "error": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "ip": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "port": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "state": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "timeMs": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / state / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / state / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / timeMs / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / timeMs / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  2. Changed8 schema fields changed
    • addedInput schema / properties / port / anyOf
      Added value: +[
      +  {
      +    "maximum": 65535,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "items": {
      +      "maximum": 65535,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "maxItems": 10,
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / port / description
      Previous value: -"TCP port to test"New value: +"TCP port, or a list of up to 10 ports, e.g. 443 or [80, 443, 25]"
    • removedInput schema / properties / port / maximum
      Removed value: -65535
    • removedInput schema / properties / port / minimum
      Removed value: -1
    • removedInput schema / properties / port / type
      Removed value: -"integer"
    • addedOutput schema / properties / partial
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / portsRequested
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / results
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "error": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "ip": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "port": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "state": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "timeMs": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "host": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "ip": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "ok": {
      +      "anyOf": [
      +        {
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "port": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "state": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "timeMs": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With annotations providing only readOnlyHint, the description carries the rest and delivers real operational context: anonymous, rate-limited per IP, host resolved first, private/reserved addresses refused including DNS answers pointing into them, and a time budget that can yield partial results. It stops short of quantifying the rate limit or time budget, so it is strong but not exhaustive.

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?

Purpose and scope are front-loaded, and every sentence conveys a distinct constraint (result taxonomy, list limit, partial flag, TCP-only, rate limits, SSRF refusal). Slightly dense and the backward-compatibility clause ('exactly as before the list form existed') costs words for limited agent value.

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

Completeness5/5

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

An output schema exists, so return structure need not be explained, yet the description still covers the ambiguous output cases (filtered semantics, partial=true) and the security/resolution preconditions. Nothing an agent needs to invoke this correctly against a 2-parameter schema is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the single-item vs list response shape ('a single-port call also gets its answer flat') and tying partial=true to the input list, which clarifies what the port argument actually produces.

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

Purpose5/5

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

States a concrete verb and resource ('Open a TCP connection to one or more ports on a host') plus the exact result taxonomy (open/closed/filtered). This clearly distinguishes it from siblings like ping_test or check_dns, which probe different layers.

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 description bounds scope ('TCP only -- there is no UDP check') and interprets 'filtered' as no answer rather than certainly closed, which helps an agent read results. However, it never names an alternative sibling or states when to prefer this over ping_test/website_status, so selection guidance is only implied.

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.

Resources