Skip to main content
Glama

mcp-optimizer

solve_traveling_salesman_problem

Calculate the shortest route for visiting all given locations with the Traveling Salesman Problem solver. Input locations, optional distance matrix, and time limits to optimize route planning efficiently.

Instructions

Solve Traveling Salesman Problem (TSP) to find the shortest route visiting all locations.

Args: locations: List of location dictionaries with name and coordinates distance_matrix: Optional pre-calculated distance matrix start_location: Index of starting location (default: 0) return_to_start: Whether to return to starting location (default: True) time_limit_seconds: Maximum solving time in seconds (default: 30.0) Returns: Optimization result with route and total distance

Input Schema

NameRequiredDescriptionDefault
distance_matrixNo
locationsYes
return_to_startNo
start_locationNo
time_limit_secondsNo

Input Schema (JSON Schema)

{ "properties": { "distance_matrix": { "anyOf": [ { "items": { "items": { "type": "number" }, "type": "array" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Distance Matrix" }, "locations": { "items": { "additionalProperties": true, "type": "object" }, "title": "Locations", "type": "array" }, "return_to_start": { "default": true, "title": "Return To Start", "type": "boolean" }, "start_location": { "default": 0, "title": "Start Location", "type": "integer" }, "time_limit_seconds": { "default": 30, "title": "Time Limit Seconds", "type": "number" } }, "required": [ "locations" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmitryanchikov/mcp-optimizer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server