Spaces:
Running
Running
Download tiled-mcp/src/tools/util.ts from 4math/tiled-map-builder: direct link, hf CLI and curl.
- Browser
- Download file 468 Bytes
-
https://huggingface.co/spaces/4math/tiled-map-builder/resolve/main/tiled-mcp/src/tools/util.ts
- Command line
-
hf download hf://spaces/4math/tiled-map-builder/tiled-mcp/src/tools/util.ts
-
curl -L -o util.ts https://huggingface.co/spaces/4math/tiled-map-builder/resolve/main/tiled-mcp/src/tools/util.ts
468 Bytes
| /** Wrap a JSON-serialisable payload as an MCP text result. */ | |
| export function asText(payload: unknown) { | |
| return { | |
| content: [{ type: "text" as const, text: JSON.stringify(payload, null, 2) }], | |
| }; | |
| } | |
| /** Shared wording so every tool explains the grid the same way. */ | |
| export const GRID_HELP = | |
| "Coordinates are grid cells: x is the column (0..width-1), y is the row (0..height-1), (0,0) is the top corner of an isometric map (top-left of an orthogonal one)."; | |