calculate_depth_of_field
Use this when you need to know how much of a scene is acceptably sharp for given camera settings, or how far sharpness extends in front of and behind the focused subject. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery. Do n...
This record as markdown: /tools/com-tttkmbb-calcgrid/calculate-depth-of-field.md
What calculate_depth_of_field does on Calcgrid
AI agents call calculate_depth_of_field to retrieve information from Calcgrid without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
coc_mm | number | — | Optional acceptable circle-of-confusion diameter; overrides the preset value (full frame 0.030, APS-C 0.020, Micro Four Thirds 0.015, 1-inch 0.011 mm). Unit: mm |
sensor | string | — | Sensor format; selects the circle of confusion (0.030 mm full frame, 0.020 mm APS-C, 0.015 mm Micro Four Thirds ...). |
aperture_f | number | Yes | Lens f-number, e.g. 2.8 for f/2.8. |
focal_length_mm | number | Yes | Actual (not equivalent) focal length of the lens in millimetres. Unit: mm. |
focus_distance_m | number | Yes | Distance from the camera's sensor plane to the focused subject in metres. Unit: m. |
Parameters from the server's own tool schema.
Why calculate_depth_of_field is rated Low
Even though calculate_depth_of_field only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Attacks that exploit this kind of access
The rule that runs calculate_depth_of_field safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Calcgrid, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For calculate_depth_of_field, this is the rule to start with:
calculate_depth_of_field is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Calcgrid, apply this rule, and every calculate_depth_of_field call is checked against it from then on.
Questions about calculate_depth_of_field
Use this when you need to know how much of a scene is acceptably sharp for given camera settings, or how far sharpness extends in front of and behind the focused subject. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery. Do not use this when you only need the focus distance that maximises depth of field (use hyperfocal-distance), or you shoot macro above about 0.2× magnification where lens extension and pupil magnification make the thin-lens equations inaccurate. What it computes: Computes the near and far limits of acceptable sharpness, the total depth of field and the hyperfocal distance from focal length, f-number, focus distance and the sensor's circle of confusion, using the standard thin-lens depth-of-field equations. Inputs: focal_length_mm (number, mm); aperture_f (number); focus_distance_m (number, m); sensor (enum, optional); coc_mm (number, mm, optional). Complete JSON argument examples: {"focal_length_mm":50,"aperture_f":2.8,"focus_distance_m":3,"sensor":"full_frame"} | {"focal_length_mm":24,"aperture_f":8,"focus_distance_m":5,"sensor":"full_frame"} Outputs: hyperfocal_m [m], near_limit_m [m], far_limit_m [m], far_limit_text, total_dof_m [m], in_front_of_subject_m [m], behind_subject_m [m], coc_used_mm [mm]. Formula: H = f² / (N·c) + f; near = s·(H − f) / (H + s − 2f); far = s·(H − f) / (H − s) when s < H, otherwise infinity (f = focal_length_mm, N = aperture_f, c = coc_mm, s = focus_distance_m × 1000, all in mm) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/depth-of-field with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/photography/depth-of-field.md. It is categorised as a Read tool in the Calcgrid MCP Server, which means it retrieves data without modifying state.
calculate_depth_of_field accepts 5 parameters: coc_mm, sensor, aperture_f, focal_length_mm, focus_distance_m. Required: aperture_f, focal_length_mm, focus_distance_m. The full parameter table on this page comes from the server's own tool schema.
Register the Calcgrid MCP server in PolicyLayer and add a rule for calculate_depth_of_field: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Calcgrid. Nothing to install.
calculate_depth_of_field is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the calculate_depth_of_field rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for calculate_depth_of_field. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
calculate_depth_of_field is provided by the Calcgrid MCP server (https://tttkmbb.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Calcgrid, and thousands of servers like it.
This server
Across the catalogue