# RevCent MCP Guide: `GetFunction`

Brief MCP-focused guide for RevCent MCP clients and agents using the `GetFunction` operation.


---

## Operation Summary

Operation:

```text
GetFunction
```

Purpose:

```text
Retrieve details for a specific Function.
```

Use `GetFunction` when you already have the target ID and need to retrieve details for a specific Function.


---

## When to Use

Good uses:

- retrieve details for a specific Function,
- support a narrow operational workflow in the RevCent ecosystem,
- retrieve or update the exact record needed for the current user request,
- avoid broad loops, exports, or reporting-style use.


---

## Input Guidance

Before calling this operation, MCP clients and agents should:

1. Use only fields supported by the MCP tool.
2. Provide exact IDs from prior RevCent MCP results whenever possible.
3. Keep list, search, date range, page, limit, and filter inputs narrow.
4. Never guess IDs, enum-like values, required values, or account configuration values.


---

## Output Summary

Treat returned IDs and status values as authoritative MCP results. When more detail is needed, use the appropriate follow-up Get operation for the selected record instead of assuming missing details.

## Function Deployment Status

Use `GetFunction` to inspect the Function `status` field when tracking deployment progress after `CreateFunction` or after an `EditFunction` dependency update.

```text
status: "READY"
```

The `status` field tracks Function deployment state:

| Status | Meaning | Update Availability | Trigger Availability |
|---|---|---|---|
| `READY` | The Function is ready. | Can be updated with `EditFunction`. | Can be triggered if configured/enabled for the trigger path. |
| `CREATING` | The Function is being created. | Cannot be updated. | Cannot be triggered. |
| `CREATE_FAILED` | Function creation failed. | Cannot be updated. | Cannot be triggered. |
| `UPDATING` | Dependencies are being redeployed after a dependency update. | Cannot be updated until deployment completes. | Can still be triggered. |
| `UPDATE_FAILED` | Dependency update failed. | Can retry the update after checking invalid dependencies or other deployment errors. | Can still be triggered. |

Deployment behavior:

- `CreateFunction` starts creation deployment.
- Updating `dependencies` with `EditFunction` triggers redeployment.
- Other `EditFunction` changes, such as trigger settings or `function_code`, do not trigger redeployment.
- A Function must be `READY` before normal `EditFunction` updates. If status is `UPDATE_FAILED`, retry the dependency update after checking dependency errors.
- After creation or dependency updates, it may take up to 5 minutes for the Function to become `READY`.
- Long polling is recommended when checking deployment status.

Do not require `READY` as a default preliminary check for isolated Function operations. It is primarily useful before calling `EditFunction`, especially after a new Function is created or after dependencies were changed.

When reviewing a Function's code, remember the current runtime expects complete handler-based JavaScript. Function code should include:

```javascript
exports.handler = async function(event, context) {
  return {
    success: true
  };
};
```

Dependencies should be loaded with CommonJS `require()`.

Function code can complete by returning a value, throwing an error, or calling `callback(error, response)`.


---

## Best Practices

1. Use exact IDs from prior RevCent MCP results whenever possible.
2. Keep operational retrieval bounded and specific.
3. Do not loop through paginated results to build reports.
4. Use `BigQueryRunQuery` for analytics or reporting.
5. Verify authorization before sharing sensitive details in customer-facing MCP flows.
6. Confirm consequential state changes before execution.


---

## Final MCP Instruction

Use `GetFunction` only when the user intent matches the operation purpose and the required inputs are known or can be safely inferred from prior RevCent MCP results.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.