Skip to main content
Glama

manage_location

Create, update, and organize locations with connections for party navigation in role-playing games. Supports lighting, hazards, tags, and connection types like doors, stairs, and portals.

Instructions

Manage location graph for party navigation. Operations: create (new location), get (retrieve location + connections), update (modify properties), delete (remove location), link (connect two locations), unlink (disconnect locations), list (all locations). Supports location types, lighting, hazards, tags, and connection types (door, passage, stairs, ladder, portal, hidden).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationNo
nameNo
descriptionNo
locationTypeNo
lightingNo
hazardsNo
tagsNo
terrainNo
sizeNo
discoveredNo
propertiesNo
locationIdNo
fromLocationIdNo
toLocationIdNo
connectionTypeNopassage
lockedNo
lockDCNo
hiddenNo
findDCNo
oneWayNo
filterTagNo
filterTypeNo

Implementation Reference

  • Registration of the 'manage_location' tool in the central registry. Imports manageLocation and manageLocationSchema from './modules/data.ts', defines inputSchema using toJsonSchema, and provides a wrapper handler that calls the actual manageLocation function with error handling.
    manage_location: {
      name: 'manage_location',
      description: 'Manage location graph for party navigation. Operations: create (new location), get (retrieve location + connections), update (modify properties), delete (remove location), link (connect two locations), unlink (disconnect locations), list (all locations). Supports location types, lighting, hazards, tags, and connection types (door, passage, stairs, ladder, portal, hidden).',
      inputSchema: toJsonSchema(manageLocationSchema),
      handler: async (args) => {
        try {
          const result = await manageLocation(args);
          return result;
        } catch (err) {
          if (err instanceof z.ZodError) {
            const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
            return error(`Validation failed: ${messages}`);
          }
          const message = err instanceof Error ? err.message : String(err);
          return error(message);
        }
      },
    },
  • Zod schema for 'manage_location' tool input validation. Discriminated union based on 'operation' field supporting create, get, update, delete, link, unlink, list operations with specific fields for each.
    export const manageLocationSchema = z.discriminatedUnion('operation', [
      createOperationSchema,
      getOperationSchema,
      updateOperationSchema,
      deleteOperationSchema,
      linkOperationSchema,
      unlinkOperationSchema,
      listOperationSchema,
    ]);
  • Main handler function for 'manage_location' tool. Parses input using manageLocationSchema, dispatches to specific operation handlers (handleCreate, handleGet, etc.), formats output as ASCII box using createBox, and returns MCP CallToolResult format.
    export async function manageLocation(input: unknown): Promise<{ content: { type: 'text'; text: string }[] }> {
      try {
        const parsed = manageLocationSchema.parse(input);
    
        let result: string;
    
        switch (parsed.operation) {
          case 'create':
            result = handleCreate(parsed);
            break;
          case 'get':
            result = handleGet(parsed);
            break;
          case 'update':
            result = handleUpdate(parsed);
            break;
          case 'delete':
            result = handleDelete(parsed);
            break;
          case 'link':
            result = handleLink(parsed);
            break;
          case 'unlink':
            result = handleUnlink(parsed);
            break;
          case 'list':
            result = handleList(parsed);
            break;
          default:
            result = createBox('ERROR', ['Unknown operation'], DISPLAY_WIDTH);
        }
    
        return { content: [{ type: 'text' as const, text: result }] };
      } catch (error) {
        const lines: string[] = [];
    
        if (error instanceof z.ZodError) {
          for (const issue of error.issues) {
            lines.push(`${issue.path.join('.')}: ${issue.message}`);
          }
        } else if (error instanceof Error) {
          lines.push(error.message);
        } else {
          lines.push('An unknown error occurred');
        }
    
        return { content: [{ type: 'text' as const, text: createBox('ERROR', lines, DISPLAY_WIDTH) }] };
      }
    }
  • In-memory state stores for locations (nodes) and edges (connections) in the location graph, used by all manage_location operations.
    const locationStore = new Map<string, Location>();
    
    /** In-memory edge storage */
    const edgeStore = new Map<string, StoredLocationEdge>();
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions operations and supported features but lacks critical behavioral details: whether operations are atomic, if deletions cascade, permission requirements, rate limits, error conditions, or what 'manage' entails beyond the listed operations. The description doesn't contradict annotations (none exist), but provides insufficient behavioral context for a tool with 22 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise but not optimally structured. It front-loads the core purpose but then presents a dense list of operations and features without clear organization. Some redundancy exists (listing connection types twice in different contexts). While not verbose, it could be more strategically organized to guide the agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 22 parameters, no annotations, and no output schema, the description is incomplete. It covers basic operations and feature categories but lacks: parameter guidance, behavioral constraints, error handling, return values, and integration with sibling tools. The absence of output schema means the description should explain what operations return, but it doesn't.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 22 parameters, the description fails to compensate for the schema's lack of documentation. It mentions some parameter concepts (location types, lighting, hazards, tags, connection types) but doesn't explain their semantics, relationships, or which parameters apply to which operations. Most parameters remain undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Manage location graph for party navigation' with specific operations listed (create, get, update, delete, link, unlink, list). It distinguishes itself from siblings by focusing on location management rather than character, encounter, or combat operations. However, it doesn't explicitly contrast with similar-sounding tools like 'manage_encounter' or 'modify_terrain'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It lists operations but doesn't indicate prerequisites, appropriate contexts, or relationships to sibling tools. For example, it doesn't clarify when to use 'manage_location' versus 'modify_terrain' or how location management interacts with 'move_party' operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/Mnehmos/ChatRPG'

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