Skip to main content
Glama
rcsb

io.github.rcsb/rcsb-mcp

Official
by rcsb

rcsb_search_by_attribute

Read-onlyIdempotent

Search PDB structures with structured attribute filters (resolution, organism, release date) combined by AND/OR, for precise results.

Instructions

Search by one or more structured attribute conditions combined with a single AND/OR — preferred over rcsb_search_fulltext whenever the request resolves to clear attribute(s) and value(s). NEVER invent, guess, or infer attributes. If you don't know a path or its operators, call rcsb_list_pdb_search_attributes first. All conditions share ONE logical_operator — NESTED boolean groups are not supported.

For a biological concept, resolve it to an ontology id first and filter on the matching annotation (see the resolver guidance in the server instructions). If a resolver returns no usable id, or a concept/annotation filter yields no hits, fall back to rcsb_search_fulltext for the concept. (For ordinary constraints — resolution, organism, dates — an empty result is a valid answer: report it, don't keyword-search instead.)

Example ("human X-ray structures better than 2 A"): attributes=[ {"attribute": "rcsb_entity_source_organism.ncbi_scientific_name", "operator": "exact_match", "value": "Homo sapiens"}, {"attribute": "exptl.method", "operator": "exact_match", "value": "X-RAY DIFFRACTION"}, {"attribute": "rcsb_entry_info.resolution_combined", "operator": "less", "value": 2.0}, ] Single-condition examples: a released-after-date filter -> {"attribute": "rcsb_accession_info.initial_release_date", "operator": "greater", "value": "2024-01-01T00:00:00Z"}; has any ligand (no value) -> {"attribute": "rcsb_nonpolymer_entity.pdbx_description", "operator": "exists"}.

Args: attributes: One or more AttributeFilter conditions, each {attribute, operator, value, negation?, case_sensitive?}. Operators are TYPE-SPECIFIC (strings use exact_match/in or contains_words/contains_phrase; numbers/dates use greater/ greater_or_equal/less/less_or_equal/equals/range; any type supports exists). A numeric value may be a number or a numeric string; a range value is a {from, to, include_lower, include_upper} object (bounds EXCLUSIVE unless the include flags are true). See rcsb_list_pdb_search_attributes for paths/operators. logical_operator: Combine the conditions with "and" (default) or "or". return_type: What to return (default "entry"); see the "Return types and fetching details" note in the server instructions. E.g. return_type="entry" with a ligand attribute finds the structures that contain it. limit: Max hits (1-100). offset: Number of hits to skip, for paging; pass the response's next_offset back with the same query to fetch the next page. all_hits: Return the COMPLETE result set in one call (for an explicit "ALL ..." request); ignores limit, can't be combined with offset, and is refused above 10000 hits. group_by, group_by_ranking: Collapse redundant polymer_entity hits into clusters, one representative each (needs return_type="polymer_entity") — see the grouping note in the server instructions. chemical: Set True for chemical-component attributes (paths from rcsb_list_pdb_search_attributes(schema="chemical"), e.g. "chem_comp.formula_weight"). Switches to the text_chem service; usually pair with return_type="mol_definition". facets: Optional aggregation specs to return a breakdown / distribution instead of hits (see the faceting note in the server instructions for the spec). sort_by: Attribute path to order the hits by. A pure attribute filter is a boolean match, so hits otherwise come back in near-arbitrary order — set this for "best resolution first", "newest first", etc. Only SORTABLE attributes work: those listing exact_match (strings) or equals (numbers/dates) in rcsb_list_pdb_search_attributes; full-text-only attributes (e.g. struct.title) and return_type="mol_definition" are rejected. sort_direction: "asc" (default) or "desc"; applies only when sort_by is set.

Returns: {total_count, returned, offset, has_more, next_offset, hits:[{id, score}], editor}; hits are ids only — batch them into rcsb_get_entries (or the rcsb_get_* tool matching return_type). The per-hit score is near-uniform for a pure attribute filter and carries NO biological meaning — don't rank hits by it. all_hits/facets response variants: see the server instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
facetsNo
offsetNo
sort_byNo
all_hitsNo
chemicalNo
group_byNo
attributesYes
return_typeNoentry
sort_directionNoasc
group_by_rankingNo
logical_operatorNoand

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent annotations, the description reveals critical behavioral traits: hits are IDs only and need batching into rcsb_get_entries, the per-hit score carries no biological meaning, all_hits is refused above 10000 hits, sort_by rejects full-text-only attributes, and nested boolean groups are unsupported. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but every sentence earns its place. It is front-loaded with the key guidance and example, followed by organized Args and Returns sections. For a 12-parameter tool, this level of detail is appropriate and free of fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides complete operational context: a full return-structure breakdown, paging via next_offset, batching guidance, and notes on grouping/faceting. It also gives concrete examples for both multi-condition and single-condition use, making the tool fully usable without external lookup.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates thoroughly. It explains every parameter (attributes, logical_operator, return_type, limit, offset, all_hits, group_by, group_by_ranking, chemical, facets, sort_by, sort_direction) with detail, including operator types, range objects, and the chemical service switch.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource statement: 'Search by one or more structured attribute conditions combined with a single AND/OR.' It clearly differentiates from rcsb_search_fulltext and includes a concrete multi-condition example, making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use guidance: 'preferred over rcsb_search_fulltext whenever the request resolves to clear attribute(s) and value(s).' It also states when to avoid keyword search for ordinary constraints and when to fall back to fulltext for biological concepts, plus a prerequisite call to rcsb_list_pdb_search_attributes for unknown paths.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rcsb/rcsb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server