Skip to main content
Glama

get_input_map

Retrieve input action mappings for Godot projects to configure keyboard, controller, and device controls for gameplay interactions.

Instructions

Get the project input action mappings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the 'get_input_map' tool, which extracts input action mappings from the project info.
    handler: async (_ctx) => {
      const info = getProjectInfo();
      if (!info) {
        return makeTextResponse({
          error: "No Godot project detected",
          data: null,
        });
      }
    
      return makeTextResponse({
        data: info.inputActions.map((a) => ({
          name: a.name,
          deadzone: a.deadzone,
          events: a.events.map((e) => {
            const filtered: Record<string, unknown> = { type: e.type };
            if (e.properties.key_name) filtered.key_name = e.properties.key_name;
            if (e.properties.physical_keycode)
              filtered.physical_keycode = e.properties.physical_keycode;
            if (e.properties.button_index) filtered.button_index = e.properties.button_index;
            if (e.properties.joypad_axis != null) filtered.joypad_axis = e.properties.joypad_axis;
            if (e.properties.axis_value != null) filtered.axis_value = e.properties.axis_value;
            for (const mod of ["ctrl_pressed", "shift_pressed", "alt_pressed", "meta_pressed"]) {
              if (e.properties[mod] === true) filtered[mod] = true;
            }
            return filtered;
          }),
        })),
        metadata: { source: "index" },
      });
    },
  • Registration of the 'get_input_map' tool within the project tools definition.
    {
      name: "get_input_map",
      description: "Get the project input action mappings.",
      schema: {},

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/woohq/godette-mcp'

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