# get-station-code-of-citys

通过中文城市名查询代表该城市的 station_code。此接口主要用于在用户提供城市名作为出发地或到达地时，为接口准备 station_code 参数。

Agent View of the PolicyLayer registry record for `get-station-code-of-citys`. HTML page: https://policylayer.com/tools/deniselewis200081-rail/get-station-code-of-citys

## Facts

- Tool: `get-station-code-of-citys`
- Server: 12306 Ticket Search Server (`DeniseLewis200081/rail`) — https://policylayer.com/tools/deniselewis200081-rail.md
- Homepage: https://github.com/DeniseLewis200081/rail
- Risk category: Read (Low risk)
- Registry record: grade A, identity unverified
- Server rate-limited: no
- Parameters: 1
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `citys` | string | no | 要查询的城市，比如"北京"。若要查询多个城市，请用\|分割，比如"北京\|上海"。 |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get-station-code-of-citys",
    "arguments": {}
  }
}
```

## Why get-station-code-of-citys is rated Low

This tool performs a simple data retrieval operation - it queries a database to return station codes corresponding to city names provided by users. This is a read-only operation with no side effects, reversible actions, code execution, data destruction, or financial impact. It serves as a prerequisite lookup for other ticket search operations.

From the tool's own definition: "Tool name 'get-station-code-of-citys' and description 'query station_code by Chinese city name' indicate a lookup/query operation that retrieves station codes for user-provided city names."

## Use case

AI agents call get-station-code-of-citys to retrieve information from 12306 Ticket Search Server without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches 12306 Ticket Search Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get-station-code-of-citys": {}
  }
}
```

## Other tools on 12306 Ticket Search Server (7)

- `get-current-date` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-current-date.md
- `get-interline-tickets` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-interline-tickets.md
- `get-station-by-telecode` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-station-by-telecode.md
- `get-station-code-by-names` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-station-code-by-names.md
- `get-stations-code-in-city` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-stations-code-in-city.md
- `get-tickets` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-tickets.md
- `get-train-route-stations` — Read — https://policylayer.com/tools/deniselewis200081-rail/get-train-route-stations.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=deniselewis200081-rail · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/deniselewis200081-rail
