AI

Restricting Fields in MCP Server Tools

Liferay DXP 2026.Q4+ Release Feature

A field restriction removes chosen fields from a tool’s responses in one MCP Server Profile, regardless of the requesting user’s permissions. For example, restricting creator in one profile keeps the details of each item’s creator out of that profile’s responses. Other profiles that use the same tool still return those fields. A restriction affects only what the tool returns, not what an MCP client can write. See Restriction Limits.

Field restrictions and data masks work differently. A data mask redacts text that matches its pattern anywhere in a profile’s responses. A field restriction removes named fields from one tool’s responses.

Note

The default profile’s tools find and invoke other tools. Restricting fields on them doesn’t affect the tools a client invokes through them.

Field restrictions are in the MCP Server application, which appears when you enable the LPD-63311 release feature flag. See Enabling the MCP Server.

Restricting a Tool’s Fields

To restrict a tool’s fields, open the profile that uses the tool and choose the fields to remove from its responses. The tool must already be in the profile. See Adding and Removing Tools.

  1. Navigate to Control Panel → MCP Server → Profiles and click the profile’s title.

  2. Click Tools.

    The Tools tab lists the profile's tools by tool set and title.

  3. Click Actions (Actions) for the tool and select Restrict Fields.

    The Restrict Fields modal lists the tool’s response fields as a tree.

  4. Check each field to restrict. Checking a parent field also restricts the fields nested under it.

    The Restrict Fields modal shows the tool's response fields as a tree with a checkbox for each field.

  5. Click Save.

To see or remove a tool’s restrictions, open its Restrict Fields modal again. The restricted fields appear checked. Uncheck a field and click Save to remove its restriction.

To confirm a restriction, connect the MCP Inspector to the profile’s endpoint, call the tool, and check that the field is absent.

For a tool that returns a page of items, the tree lists the fields of each item, such as name, rather than the page’s own fields. Restricting a localized field also restricts its _i18n version, such as name_i18n.

How Restrictions Are Applied

The MCP server removes a restricted field from every response of the tool, including the entity that a POST, PUT, or PATCH request returns. The field is also absent from the values the tool offers for the fields parameter.

The MCP server rejects a filter or sort parameter that references a restricted field or a path below it, such as creator.name when creator is restricted.

Restriction Limits

These limits apply to field restrictions:

  • The MCP server doesn’t check an aggregationTerms or search parameter that involves a restricted field. It forwards the parameter unchanged.

  • Restricting a top-level field doesn’t restrict the same-named field of an expanded related entity. To restrict that field too, restrict its nested path, such as parent.name.

  • Restrictions apply only to what a tool returns, not to request bodies. The MCP server forwards a restricted field in a POST, PUT, or PATCH body unchanged, and the tool’s input schema still lists it as a request body property, so an MCP client can still write a restricted field.

Restricting Fields Through the REST API

Each tool in a profile is an entry at /o/mcp/server-profile-tools. The entry’s restrictFields property holds the restricted fields as comma-separated paths, such as description,creator.name.

To find a profile’s tool entries, follow these steps:

  1. Send a GET request to /o/mcp/server-profiles, and note the externalReferenceCode of the profile whose name is the profile’s Title.

  2. Send a GET request to /o/mcp/server-profile-tools with the URL-encoded filter parameter r_mcpServerProfileToTools_l_mcpServerProfileERC eq '[profile ERC]'. Each entry in the response has externalReferenceCode, toolName, toolSetName, and restrictFields properties.

To change an entry’s restricted fields, send a PATCH request to /o/mcp/server-profile-tools/by-external-reference-code/[ERC], where [ERC] is the entry’s external reference code. This request restricts description and creator:

curl \
	"http://localhost:8080/o/mcp/server-profile-tools/by-external-reference-code/[ERC]" \
	--data-raw '{"restrictFields": "description,creator"}' \
	--header "Content-Type: application/json" \
	--request "PATCH" \
	--user "test@liferay.com:learn"

Keep these rules in mind when you set restrictFields:

  • For a tool that returns a page of items, write each path relative to an item, such as description rather than items.description.
  • A path can’t repeat or sit below another restricted path, so creator,creator.name is rejected.
  • The API doesn’t check paths against the tool’s output schema, so a misspelled path restricts nothing.
  • When you check a parent field in the Restrict Fields modal, the entry stores only the parent’s path.
  • To remove every restriction on an entry, send "restrictFields": "".