
This guide shows how to set up location and datetime context injection for agents and MCP tools.

## Prerequisites

- Daneel AI installed
- (Optional) An [agent](/how-to/agents/) or [MCP server](/how-to/mcp-server/) configured

## Enable datetime injection

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.

## Enable geolocation

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.

:::note
Location is resolved at city level using WiFi/IP positioning (not GPS). The coordinates are sent to OpenStreetMap's Nominatim service once per session and cached in memory.
:::

## Mark an MCP server as location-aware

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.

## Configure an agent with context overrides

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.

## Example: travel planner agent

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.

## Verify what the AI sees

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.

## Troubleshooting

**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.

## Next steps

- [Environment Context](/concepts/context-injection/) — how the three-tier architecture works
- [Privacy Model](/concepts/privacy/) — what data leaves your machine
- [MCP and Tool Calling](/concepts/mcp/) — how agents use tools with context
