Skip to main content
Glama

Get Fill Light Position (Spherical Coordinates)

get_fill_light_position_spherical

Retrieve the current fill light position in spherical coordinates relative to the camera. Use this to maintain accuracy when making relative lighting adjustments in 3D scenes.

Instructions

Get the current fill light position in camera-centric spherical coordinates. Query this before relative position changes (e.g., "rotate light 10 degrees") to ensure accuracy. For absolute changes, you may use recently queried state from context if no manual interactions occurred.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler implementation for get_fill_light_position_spherical. This function retrieves the current fill light position in camera-centric spherical coordinates (azimuth, elevation, distance) from the browser state and returns it formatted with metadata including source and timestamp.
    mcpServer.registerTool(
      'get_fill_light_position_spherical',
      {
        title: 'Get Fill Light Position (Spherical Coordinates)',
        description: 'Get the current fill light position in camera-centric spherical coordinates. ' +
          'Query this before relative position changes (e.g., "rotate light 10 degrees") to ensure accuracy. ' +
          'For absolute changes, you may use recently queried state from context if no manual interactions occurred.',
        inputSchema: {}
      },
      async () => {
        const sessionId = getCurrentSessionId();
        if (!sessionId) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: No active session found.'
              }
            ],
            isError: true
          };
        }
    
        try {
          const { state, metadata } = await getState(sessionId);
          const position = state.fillLight?.position || { azimuth: 0, elevation: 0, distance: 0 };
          const positionText = `azimuth ${position.azimuth}°, elevation ${position.elevation}°, distance ${position.distance}`;
          
          return {
            content: [
              {
                type: 'text',
                text: formatStateResponse(positionText, 'Fill light position', sessionId, metadata)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error retrieving fill light position: ${error.message}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • server.js:1355-1363 (registration)
    Tool registration for get_fill_light_position_spherical. Registers the tool with MCP server including title, description, and empty inputSchema definition.
    mcpServer.registerTool(
      'get_fill_light_position_spherical',
      {
        title: 'Get Fill Light Position (Spherical Coordinates)',
        description: 'Get the current fill light position in camera-centric spherical coordinates. ' +
          'Query this before relative position changes (e.g., "rotate light 10 degrees") to ensure accuracy. ' +
          'For absolute changes, you may use recently queried state from context if no manual interactions occurred.',
        inputSchema: {}
      },
  • Azimuth schema definition used by fill light position tools. Accepts numbers (0-360) or direction names as strings, with validation against availableDirectionNames.
    const azimuthSchema = z.union([
      z.number().min(0).max(360),
      z.string().refine(
        (val) => {
          const normalized = normalizeDirectionName(val);
          return normalized && directionToAzimuthMap.has(normalized);
        },
        {
          message: `Must be a number (0-360) or a direction name. Available directions: ${availableDirectionNames}`
        }
      )
    ]).describe(`Horizontal angle in degrees (0-360) or direction name (e.g., "north", "northwest", "NW"). 0° = camera forward (North), 90° = camera right (East), 180° = behind camera (South), 270° = camera left (West). Available directions: ${availableDirectionNames}`);
  • Helper function getState that queries state from the browser (or uses cache if unavailable). Used by get_fill_light_position_spherical to retrieve current fill light position data.
    async function getState(sessionId) {
      let state;
      let source;
      let wasCached = false;
      
      // Always query browser for current state
      try {
        state = await queryStateFromBrowser(sessionId);
        source = 'fresh';
      } catch (error) {
        // If query fails, fall back to cache if available (browser may be disconnected)
        const cached = sessionStateCache.get(sessionId);
        if (cached) {
          console.warn(`Browser query failed for session ${sessionId}, returning cached state: ${error.message}`);
          state = cached.state;
          source = 'cache';
          wasCached = true;
        } else {
          // No cache available, throw error
          throw new Error(`Unable to retrieve state: ${error.message}. Browser may be disconnected.`);
        }
      }
      
      // Return state with metadata
      return {
        state,
        metadata: {
          source,
          wasCached,
          timestamp: new Date().toISOString()
        }
      };
    }
  • Helper function formatStateResponse that formats state query responses with metadata (timestamp, source, staleness warning). Used by get_fill_light_position_spherical to format the output.
    function formatStateResponse(value, propertyName, sessionId, metadata) {
      const timestamp = metadata.timestamp;
      const source = metadata.source;
      const stalenessWarning = metadata.wasCached 
        ? ' (using cached state - browser may be disconnected)' 
        : '';
      
      return `${propertyName}: ${value} (queried at ${timestamp}, source: ${source}${stalenessWarning})`;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior as a read-only query ('Get the current...'), implies it's non-destructive, and adds context about state accuracy and manual interactions. However, it doesn't mention potential errors, rate limits, or authentication needs, leaving some gaps.

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

Conciseness5/5

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

The description is efficiently structured in two sentences: the first states the purpose, and the second provides usage guidelines. Every sentence adds value without redundancy, making it front-loaded and easy to parse.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is nearly complete. It covers purpose, usage, and behavioral context well. However, it lacks details on the return format (e.g., what values are returned) and error handling, which could be useful for an AI agent.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description doesn't need to explain parameters, and it doesn't add any parameter-specific information, which is appropriate given the empty schema.

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

Purpose5/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: 'Get the current fill light position in camera-centric spherical coordinates.' It specifies the exact resource (fill light position) and coordinate system (camera-centric spherical), distinguishing it from sibling tools like 'get_key_light_position_spherical' or other light-related getters.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Query this before relative position changes (e.g., "rotate light 10 degrees") to ensure accuracy. For absolute changes, you may use recently queried state from context if no manual interactions occurred.' It tells when to use it (before relative changes) and offers an alternative (using context for absolute changes), which is highly specific and actionable.

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/aidenlab/hello3dmcp-server'

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