Skip to main content
Glama

Look up a port assignment

iana_lookup_port
Read-onlyIdempotent

Look up IANA service name and transport protocol port assignments. Pass exactly one of port (a number, 0–65535), service (an exact service name such as "postgresql"), or keyword (words matched against service names and descriptions). Results list every transport (tcp, udp, sctp, dccp) separately, report the registry range row containing an unassigned port, and classify the port as System (0–1023), User (1024–49151), or Dynamic/Private (49152–65535). Service names registered without a port (DNS-SD names) appear with no port.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "iana_lookup_port"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNoPort number, 0–65535 (a digit string such as "443" also works). Returns every row for that port plus the range row containing it. Pass exactly one of port, service, or keyword.
limitNoRequested maximum results as a positive safe integer. Values above 5000 are clamped to 5000 and disclosed as requested_limit and effective_limit. Default 25.
offsetNoNumber of keyword matches to skip; pass the next_offset of the previous response to get the next page. Default 0.
keywordNoWords matched as whole tokens against service names and descriptions, e.g. "network time". On a miss, query tokens of three or more characters can match service-name prefixes, e.g. "postgres" for "postgresql". Pass exactly one of port, service, or keyword.
serviceNoExact service name, case-insensitive, up to 15 characters, e.g. "postgresql" or "whois++". A name miss on three or more characters suggests registered service names with that prefix. Pass exactly one of port, service, or keyword.
transportNoKeep only rows for this transport protocol. Rows without a transport (most range rows and every service name without a port) are always kept. Applies to every mode.

Output Schema

NameRequiredDescriptionDefault
capNoThe limit applied.
modeNoWhich lookup ran.
errorNoPresent when the call failed. Absent on success.
foundNoTrue when a matching row after transport filtering has a registered service name; keyword mode checks all matches before paging.
shownNoResults returned.
noticeNoGuidance on a miss, a cut list, or another condition.
sourceNoProvenance and freshness of the answer.
truncatedNoTrue when more matches exist than were returned.
port_classNoPort mode: the requested port's class.
totalCountNoMatches before the limit was applied.
assignmentsNoMatching rows. Port mode: exact rows, then range rows containing the port. Other modes: ascending by port, port-less rows last.
next_offsetNoPass as offset for the next page; absent on the last.
effective_limitNoThe response limit after clamping, present when clamped.
requested_limitNoThe requested limit, present when clamped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changed
    • changedInput schema / properties / keyword / description
      Previous value: -"Words matched as whole tokens against service names and descriptions, e.g. \"network time\". Pass exactly one of port, service, or keyword."New value: +"Words matched as whole tokens against service names and descriptions, e.g. \"network time\". On a miss, query tokens of three or more characters can match service-name prefixes, e.g. \"postgres\" for \"postgresql\". Pass exactly one of port, service, or keyword."
    • removedInput schema / properties / keyword / maxLength
      Removed value: -100
    • removedInput schema / properties / keyword / minLength
      Removed value: -2
    • addedInput schema / properties / keyword / pattern
      Added value: +"^\\s*(?:\\S[\\s\\S]{0,98}\\S\\s*)?$"
    • addedInput schema / properties / limit / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "pattern": "^\\s*(?:\\d{1,16}\\s*)?$",
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / limit / description
      Previous value: -"Requested maximum results, 1–1,000,000; values above 100 are clamped to 100 and disclosed as requested_limit and effective_limit. Default 25."New value: +"Requested maximum results as a positive safe integer. Values above 5000 are clamped to 5000 and disclosed as requested_limit and effective_limit. Default 25."
    • removedInput schema / properties / limit / maximum
      Removed value: -1000000
    • removedInput schema / properties / limit / type
      Removed value: -"integer"
    • addedInput schema / properties / offset / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "pattern": "^\\s*(?:\\d{1,15}\\s*)?$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / offset / type
      Removed value: -"integer"
    • addedInput schema / properties / port / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "pattern": "^\\s*(?:\\d{1,15}\\s*)?$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / port / type
      Removed value: -"integer"
    • changedInput schema / properties / service / description
      Previous value: -"Exact service name, case-insensitive, up to 15 characters, e.g. \"postgresql\" or \"whois++\". Pass exactly one of port, service, or keyword."New value: +"Exact service name, case-insensitive, up to 15 characters, e.g. \"postgresql\" or \"whois++\". A name miss on three or more characters suggests registered service names with that prefix. Pass exactly one of port, service, or keyword."
    • changedInput schema / properties / service / pattern
      Previous value: -"^[A-Za-z0-9+*/._-]{1,15}$"New value: +"^\\s*(?:[A-Za-z0-9+*/._-]{1,15}\\s*)?$"
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `mode_required`: None, or more than one, of port, service, and keyword was given. `upstream_unreadable`: The port registry file could not be fetched, was larger than this server accepts, or parsed to zero records. `pacer_shed`: This server's own iana.org request queue is too full for the call to start in time. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `mode_required`: None, or more than one, of port, service, and keyword was given. `upstream_unreadable`: The port registry file could not be fetched, was incomplete or malformed XML, was larger than this server accepts, or parsed to zero records. `pacer_shed`: This server's own iana.org request queue is too full for the call to start in time. Other values are possible when a failure originates below the handler."
  2. Changed1 schema field changed
    • changedOutput schema / properties / found / description
      Previous value: -"True when a returned row has a registered service name."New value: +"True when a matching row after transport filtering has a registered service name; keyword mode checks all matches before paging."
  3. Changed4 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results to return, 1–100. Default 25."New value: +"Requested maximum results, 1–1,000,000; values above 100 are clamped to 100 and disclosed as requested_limit and effective_limit. Default 25."
    • changedInput schema / properties / limit / maximum
      Previous value: -100New value: +1000000
    • addedOutput schema / properties / effective_limit
      Added value: +{
      +  "description": "The response limit after clamping, present when clamped.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / requested_limit
      Added value: +{
      +  "description": "The requested limit, present when clamped.",
      +  "type": "number"
      +}
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and open-world, so the safety profile is covered. Beyond that, the description discloses real behavioral detail: results are split per transport, an unassigned port still returns the containing range row, ports are classified into System/User/Dynamic ranges, and DNS-SD names appear with no port — none of which the annotations convey.

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?

Four sentences, front-loaded with purpose and then mode constraint, with no filler. A few clauses restate what the schema already documents (0–65535, exact service names), which is mild redundancy but not wasteful.

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?

An output schema exists, yet the description still usefully previews return semantics (per-transport rows, range rows, classification) so the agent can interpret results. Combined with full schema coverage and clear annotations, an agent has everything needed to call it correctly; only cross-tool routing guidance is absent.

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 every parameter is already documented in the schema, including the limit clamp and offset paging. The description restates the port range and the exactness of `service` without adding syntax or format detail beyond the schema, so the baseline of 3 applies.

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?

The first sentence names a specific verb and resource — looking up IANA service-name and transport-protocol port assignments — which is immediately distinguishable from siblings covering HTTP fields, media types, PENs, and so on. It also scopes the registry precisely (service name + transport protocol), so an agent knows this is not the general registry search tool.

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

Usage Guidelines4/5

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

The description gives clear mode-selection guidance by stating 'Pass exactly one of port, service, or keyword' and illustrating each mode with an example. It stops short of stating when to prefer this tool over siblings like iana_search_registries or when a mode should be avoided, so there are no explicit exclusions.

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.