Guides

Before your agent calls an API, inspect it

Check the inputs, pricing and result contract before paying for a request.

Glasser2 min read

Finding an endpoint with a promising name is only the start. A company search might return a list of matches, while an enrichment endpoint might expect an identifier for a company you already know. Running the wrong one can produce data that does not answer your question.

Glasser separates finding an endpoint from inspecting its contract and running it. Use that inspection step to decide whether a request is worth making.

Define the answer you need

Tell your agent what the result must contain. For a company shortlist, that might be a company name, website, location and evidence that it fits your criteria. For a price comparison, specify the product, currency and region.

This gives the agent a way to reject an endpoint that covers the right topic but cannot supply the required information. It also helps it avoid collecting fields that the task will never use.

Check three parts of the contract

After searching the data sources, inspect the candidate endpoint. Do not infer its inputs from another provider's API or from a previous request.

  • Inputs: required fields, accepted values and any controls for the number of results.
  • Price: the billable unit, maximum charge and the stated charge clauses for other outcomes.
  • Results: the available output description and whether the fields support your intended decision.

Read one response before starting a batch

Make a small, scoped request first. Look at the returned records and check whether the identifiers, dates and other required fields are present. An output description helps you plan, but it does not establish that every record will contain every field.

Glasser returns the provider's output rather than replacing it with an editorial summary. Ask your agent to distinguish what the response contains from what it infers. If a field is missing, keep it missing in the final result instead of filling it with a guess.

Keep the result connected to the request

A useful handoff includes the records, the criteria used and the Run URL. That gives your workspace a way to return to the retrieved data when someone questions a conclusion.

If the first response is unsuitable, change the query or choose another endpoint before multiplying the same mistake across a batch. Inspection earns its place by reducing that avoidable work.