Get Data Source Fields

The get_data_source_fields tool returns field-level metadata for a Data Source or Datamart on a Pricefx partition.

The get_data_source_fields tool has been deprecated in MCP Server CD6 Iteration 6.

Tool Name – get_data_source_fields

Title – Get Data Source Fields

Type – Private

Access Profile – Operator

Permissions

The get_data_source_fields tool uses your Pricefx permissions. The tool returns only the fields that you have permission to query. If you do not have access to the Datamart or Data Source, the tool returns the same error as for a Datamart or Data Source that does not exist.

Parameters

Parameter

Required

Description

data_source_name

Yes

Technical name of the Datamart or Data Source, for example Standard_Sales_Data. Get the exact name from the List Data Sources tool. Leading and trailing spaces are removed.

type

Yes

DATAMART or DATASOURCE, as the List Data Sources tool returns it. Not case-sensitive.

filter

No

Text that the field name or field label contains, for example price. The search is not case-sensitive. The default is no filter, which lists every field.

The type parameter is required because a Datamart and a Data Source can have the same name, with different fields. The tool does not detect or correct the type, and it does not try the other type.The type parameter must match the requested object. The tool does not automatically detect or correct an incorrect type.

Output

The get_data_source_fields tool returns:

Field

Description

table

Technical name of the Datamart or Data Source.

type

DATAMART or DATASOURCE.

total

Number of returned fields. The tool returns every matching field.

fields

List of fields.

Each entry in fields has:

Attribute

Description

name

Technical field name. Use this name in queries.

label

Display label. If no label is set, the tool shows the technical name.

type

Field type, for example TEXT, NUMBER, MONEY, QUANTITY, DATE, or BOOLEAN. Other values are possible.

format

Display format. Empty when no format is set.

dimension

true if the field is a dimension.

measure

true if the field is numeric and not a dimension.

dateField

true if the field type is DATE or DATETIME.

expression

Formula of a calculated field. Empty for other fields.

metaDescription

Business description of the field. Empty when no description is set, which is common.

Behavior and Limitations

  • The tool lists the fields in the order Pricefx returns them.

  • The tool returns all matching fields in one response, with no limit.

  • If nothing matches the filter, the tool returns an empty list, not an error.

  • The tool returns field metadata only, not data. To read the data, use the Datamart Query Data tool.

  • The tool requires Pricefx version 16.3.16 or later.

Errors

Situation

Error Message

type is not DATAMART or DATASOURCE

type must be "DATAMART" or "DATASOURCE", got 'X'. Pass the type list_data_sources reported for the table.

The Datamart or Data Source does not exist, you do not have access to it, or type is wrong for it

No Datamart named 'X' is available to you. Call list_data_sources to see the tables you can query, and pass the type it reports: the same name can exist under the other kind.

The Datamart or Data Source exists but Pricefx reports no fields for it

The partition lists Datamart 'X' but reports no queryable columns for it, so its fields cannot be described here.

See Also