Skip to content

How to Use Environment Context

This guide shows how to set up location and datetime context injection for agents and MCP tools.

Datetime injection is on by default. To verify or change it:

  1. Open Settings > Privacy.
  2. Check that Share date & timezone with agents is toggled on.

When enabled, every prompt sent to the AI includes the current date, time, and IANA timezone. No permission is needed.

Geolocation is off by default and requires a one-time browser permission:

  1. Open Settings > Privacy.
  2. Toggle Share location with agents on.
  3. The browser will briefly switch to an extension tab and show a permission prompt: “Daneel AI wants to know your location.”
  4. Click Allow.
  5. Focus returns to your page automatically.

If you click Block, the toggle stays off. You can retry later or enable location in Chrome’s site settings for the extension.

If you use an MCP server whose tools benefit from knowing your location (e.g., Google Maps, a weather API):

  1. Open Settings > MCP.
  2. Find the server in the Registered Servers list.
  3. Click the location badge next to the server name. It turns blue when active.
  4. Optionally click the datetime badge too (though datetime is injected by default for all MCP-connected flows).

Any agent that binds this server will automatically inherit the location requirement — no per-agent configuration needed.

If you want an agent to always receive location regardless of its MCP servers, or to opt out of datetime:

  1. Open Settings > Agents.
  2. Create or edit an agent.
  3. Scroll to the Context section at the bottom of the editor.
  4. Set the checkboxes:
    • Uses location — three states: checked (always inject), unchecked (never inject), indeterminate (inherit from servers)
    • Uses date & time — same three states

Click through the checkbox to cycle: indeterminate (inherit) → checked (force on) → unchecked (force off) → indeterminate.

A practical configuration for a location-aware agent:

  1. Enable geolocation in Settings > Privacy.
  2. Create an agent in Settings > Agents:
    • Name: Travel Planner
    • Purpose: Plan trips and find local attractions
    • Persona: “You are an experienced travel planner who knows local customs, transportation, and dining.”
    • Task: “Help users plan trips, find nearby attractions, and suggest restaurants. Always consider their current location and local time when making recommendations.”
    • Context: Uses location = checked, Uses date & time = checked
  3. Attach the agent to a chat conversation.
  4. Ask: “What restaurants are open near me right now?”

The AI will see your city and current time in its context and respond accordingly.

To confirm context injection is working, ask the agent directly:

“What is my current location and the current date and time?”

The AI will report the injected values from the ## Environment Context section of its system prompt.

Location not appearing:

  • Check that “Share location with agents” is on in Settings > Privacy
  • Check that the agent has “Uses location” checked, or that a bound MCP server has the location badge active
  • Verify you granted browser geolocation permission (check Chrome’s address bar for the location icon)

Permission prompt never appeared:

  • The prompt shows on the extension’s host tab. If it was blocked by a popup blocker, navigate to chrome://settings/content/location and allow the extension

Wrong city displayed:

  • Nominatim resolves based on WiFi/IP positioning, which can be approximate. This is normal — the goal is city-level context, not street-level precision.