create_route
Generate and configure routes in APISIX-MCP to define traffic flow, specify HTTP methods, hosts, and plugins, and integrate with upstream services.
Instructions
Create a route
Input Schema
Name | Required | Description | Default |
---|---|---|---|
id | No | route id | |
route | Yes | route configuration |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "route id",
"type": "string"
},
"route": {
"additionalProperties": true,
"description": "route configuration",
"properties": {
"desc": {
"description": "route description",
"maxLength": 256,
"type": "string"
},
"enable_websocket": {
"description": "enable websocket",
"type": "boolean"
},
"filter_func": {
"description": "route filter function",
"type": "string"
},
"host": {
"description": "route host",
"type": "string"
},
"hosts": {
"description": "allowed hosts",
"items": {
"type": "string"
},
"type": "array"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "route labels",
"type": "object"
},
"methods": {
"description": "allowed HTTP methods",
"items": {
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"TRACE",
"CONNECT",
"PURGE"
],
"type": "string"
},
"type": "array"
},
"name": {
"description": "route name",
"type": "string"
},
"plugins": {
"additionalProperties": {},
"description": "plugins",
"type": "object"
},
"priority": {
"default": 0,
"description": "route priority",
"type": "number"
},
"remote_addr": {
"description": "allowed remote address",
"type": "string"
},
"remote_addrs": {
"description": "allowed remote addresses",
"items": {
"type": "string"
},
"type": "array"
},
"script": {
"additionalProperties": {},
"description": "route script configuration",
"type": "object"
},
"service_id": {
"description": "service id",
"type": "string"
},
"service_protocol": {
"description": "service protocol",
"type": "string"
},
"status": {
"description": "route status",
"enum": [
0,
1
],
"type": "number"
},
"upstream": {
"additionalProperties": true,
"description": "upstream configuration",
"properties": {
"checks": {
"additionalProperties": false,
"description": "health check configuration",
"properties": {
"active": {
"additionalProperties": false,
"description": "active health check configuration",
"properties": {
"healthy": {
"additionalProperties": false,
"properties": {
"interval": {
"description": "check interval for healthy status",
"type": "number"
},
"successes": {
"description": "success count threshold",
"type": "number"
}
},
"type": "object"
},
"host": {
"description": "host for health check",
"type": "string"
},
"http_path": {
"description": "HTTP path for health check",
"type": "string"
},
"https_verify_certificate": {
"description": "verify HTTPS certificate",
"type": "boolean"
},
"port": {
"description": "port for health check",
"type": "number"
},
"timeout": {
"description": "timeout for health check",
"type": "number"
},
"unhealthy": {
"additionalProperties": false,
"properties": {
"http_failures": {
"description": "HTTP failure count threshold",
"type": "number"
},
"interval": {
"description": "check interval for unhealthy status",
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
},
"passive": {
"additionalProperties": false,
"description": "passive health check configuration",
"properties": {
"healthy": {
"additionalProperties": false,
"properties": {
"http_statuses": {
"description": "HTTP status codes for healthy state",
"items": {
"type": "number"
},
"type": "array"
},
"successes": {
"description": "success count threshold",
"type": "number"
}
},
"type": "object"
},
"unhealthy": {
"additionalProperties": false,
"properties": {
"http_failures": {
"description": "HTTP failure count threshold",
"type": "number"
},
"http_statuses": {
"description": "HTTP status codes for unhealthy state",
"items": {
"type": "number"
},
"type": "array"
},
"timeout": {
"description": "timeout threshold",
"type": "number"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"desc": {
"description": "upstream description",
"maxLength": 256,
"type": "string"
},
"hash_on": {
"description": "hash on type for chash algorithm",
"enum": [
"vars",
"header",
"cookie",
"consumer",
"vars_combinations"
],
"type": "string"
},
"keepalive_pool": {
"additionalProperties": false,
"description": "keepalive pool configuration",
"properties": {
"idle_timeout": {
"default": 60,
"description": "idle timeout",
"type": "number"
},
"requests": {
"default": 1000,
"description": "requests",
"type": "number"
},
"size": {
"default": 320,
"description": "size",
"type": "number"
}
},
"type": "object"
},
"key": {
"description": "hash key for chash algorithm",
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "upstream labels",
"type": "object"
},
"name": {
"description": "upstream name",
"type": "string"
},
"nodes": {
"description": "upstream nodes with weights",
"items": {
"additionalProperties": false,
"properties": {
"host": {
"description": "upstream host",
"type": "string"
},
"port": {
"description": "upstream port",
"type": "number"
},
"priority": {
"description": "upstream priority",
"minimum": 0,
"type": "number"
},
"weight": {
"description": "upstream weight",
"minimum": 0,
"type": "number"
}
},
"required": [
"host",
"port"
],
"type": "object"
},
"type": "array"
},
"pass_host": {
"default": "pass",
"description": "host passing mode",
"enum": [
"pass",
"node",
"rewrite"
],
"type": "string"
},
"retries": {
"description": "retry count",
"minimum": 0,
"type": "number"
},
"retry_timeout": {
"description": "retry timeout",
"minimum": 0,
"type": "number"
},
"scheme": {
"default": "http",
"description": "upstream scheme",
"enum": [
"http",
"https",
"grpc",
"grpcs",
"tcp",
"tls",
"udp",
"kafka"
],
"type": "string"
},
"timeout": {
"additionalProperties": false,
"description": "timeout configuration",
"properties": {
"connect": {
"description": "connection timeout in seconds",
"type": "number"
},
"read": {
"description": "read timeout in seconds",
"type": "number"
},
"send": {
"description": "send timeout in seconds",
"type": "number"
}
},
"type": "object"
},
"tls": {
"additionalProperties": false,
"description": "TLS configuration",
"properties": {
"client_cert": {
"description": "TLS certificate",
"type": "string"
},
"client_cert_id": {
"description": "TLS certificate id",
"items": {
"type": "string"
},
"type": "array"
},
"client_key": {
"description": "TLS key",
"type": "string"
},
"verify": {
"description": "TLS verification",
"type": "boolean"
}
},
"type": "object"
},
"type": {
"default": "roundrobin",
"description": "load balancing algorithm",
"enum": [
"roundrobin",
"chash",
"ewma",
"least_conn"
],
"type": "string"
},
"upstream_host": {
"description": "upstream host for rewrite mode",
"type": "string"
}
},
"type": "object"
},
"upstream_id": {
"description": "upstream id",
"type": "string"
},
"uri": {
"description": "route path",
"type": "string"
},
"uris": {
"description": "multiple route paths",
"items": {
"type": "string"
},
"type": "array"
},
"vars": {
"description": "route match variables",
"items": {
"type": "array"
},
"type": "array"
}
},
"required": [
"uri"
],
"type": "object"
}
},
"required": [
"route"
],
"type": "object"
}
You must be authenticated.
Other Tools from APISIX-MCP
- create_consumer_group
- create_global_rule
- create_or_update_consumer
- create_or_update_credential
- create_or_update_plugin_metadata
- create_or_update_proto
- create_or_update_stream_route
- create_plugin_config
- create_route
- create_secret
- create_service
- create_ssl
- create_upstream
- delete_credential
- delete_plugin_metadata
- delete_resource
- delete_secret
- get_all_plugin_names
- get_credential
- get_plugin_metadata
- get_plugin_schema
- get_resource
- get_secret_by_id
- update_consumer_group
- update_global_rule
- update_plugin_config
- update_route
- update_secret
- update_service
- update_ssl
- update_upstream
Related Tools
- @api7/apisix-mcp
- @api7/apisix-mcp
- @api7/apisix-mcp
- @api7/apisix-mcp
- @api7/apisix-mcp