Skip to main content
Glama

mcp_library_search

MCP server:查询城市图书馆的馆藏与可借状态——回答"这本书在哪些馆能借到"。

支持情况

城市

标识

状态

数据源

上海

shanghai

✅ 已接入

上海中心图书馆"一卡通"总分馆体系(900+ 网点,含地铁站 24 小时自助机)

深圳

shenzhen

🔜 待接入

—

更多城市

—

欢迎提需求或贡献适配器

—

Related MCP server: NLB Singapore Library MCP Server

安装

Claude Code

claude mcp add mcp-library-search -- uvx mcp_library_search

Claude Desktop

在 claude_desktop_config.json 里加:

"mcpServers": {
  "mcp-library-search": {
    "command": "uvx",
    "args": ["mcp_library_search"]
  }
}

改完重启桌面版。

使用

接入后提供 3 个 tool,查询链路为:先 search_books 按关键字找到 book_id,再用它查馆藏或详情。都带 city 参数(默认 shanghai,未接入的城市会返回明确提示):

tool

作用

search_books(keyword, city, page, limit)

按关键字(书名、ISBN、作者等)搜书,返回分页列表,每条带 book_id 和可借概况

find_book_availability(book_id, city, only_available)

查这本书在哪些馆有、是否可借,可借的馆排前面;only_available=False 时已借出的馆藏带预计归还时间(due_date)

get_book_detail(book_id, city)

查这本书的完整介绍(ISBN、索书号、内容简介)

典型用法:对 Claude 说"帮我查《三体》在哪个馆能借到" → 搜书拿到 book_id → 查各馆可借状态 → 就近推荐。

致谢

完整的第三方组件列表、归属与变更说明见 NOTICE。

Available Tools

3 tools
find_book_availabilityFind Book AvailabilityA

查询指定图书在各分馆的馆藏与可借状态,可借的馆排前面。

已借出的馆藏可能带 due_date(预计归还时间,YYYY-MM-DD),仅在 only_available=False 时出现;数据源查不到时为空串。

参数: book_id:search_books 返回的图书 ID,需与 search_books 使用同一 city city:城市标识,默认 "shanghai" only_available:True(默认)只返回当前可借的馆;False 返回全部馆藏

ParametersJSON Schema
NameRequiredDescriptionDefault
cityNoshanghai
book_idYes
only_availableNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so well: it discloses ordering (available branches first), the conditional due_date field and its format, that due_date only appears when only_available=False, and the empty-string fallback when the data source misses. It omits error handling and any permission/latency context, which keeps it from a 5.

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

Conciseness4/5

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

The body is front-loaded with the core behavior and then a compact parameter list, so it reads efficiently. The due_date explanation is worth its space, though the parameter block partly restates names and defaults already visible in the schema.

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

Completeness4/5

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

An output schema exists, so return structure need not be re-explained, and the description still adds useful field-level nuance (due_date, ordering, empty string). For a 3-parameter read tool with no annotations, this is nearly complete; only failure/edge-case behavior is unaddressed.

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?

Schema coverage is 0% and the description fully compensates: book_id is tied to search_books output and constrained to the same city, city carries its default value, and only_available is explained as a true/false filter with distinct result sets. This adds meaning well beyond the bare schema.

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 states a specific verb and resource — querying a book's holdings and borrowable status across branches — and immediately differentiates itself by noting the relationship to search_books (book_id must come from there and share the same city). An agent can distinguish it from search_books and get_book_detail without opening any schema.

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

Usage Guidelines4/5

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

It clearly establishes the context in which this tool applies (called after search_books, with matching city) and explains the only_available switch as the main usage decision. It stops short of explicitly stating when to prefer get_book_detail or what to do on a failed lookup, so it is strong but not exhaustive.

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

get_book_detailGet Book DetailA

查询指定图书的完整介绍:书名、作者、出版社、出版年、ISBN、索书号、内容简介。

上海数据源没有独立简介区块,内容简介取自书目"附注"字段,可能带有 "新版本册内容:"之类的原生前缀。

参数: book_id:search_books 返回的图书 ID,需与 search_books 使用同一 city city:城市标识,默认 "shanghai"

ParametersJSON Schema
NameRequiredDescriptionDefault
cityNoshanghai
book_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
isbnYes
titleYes
authorYes
book_idYes
summaryYes
publisherYes
call_numberYes
publish_yearYes

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose a non-obvious data trait: the Shanghai source has no dedicated summary block, so 内容简介 is pulled from the '附注' field and may carry native prefixes. That is genuinely useful behavioral context. It does not cover permissions, error behavior, or rate limits.

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

Conciseness4/5

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

Front-loaded with the return contents, then the data-source caveat, then the parameters – a sensible order with no filler. It is somewhat long for two parameters, but every clause adds information.

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

Completeness4/5

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

An output schema exists, so return shape needn't be explained, and both parameters plus the cross-tool coupling are covered. The remaining gap is the absence of any safety/permission statement for a tool with zero annotations.

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?

Schema coverage is 0%, so the description must compensate entirely, and it does: book_id is defined as 'the book ID returned by search_books' with a same-city coupling constraint, and city is defined with its default. Both parameters gain semantics that the bare schema lacks.

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

Purpose4/5

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

States a specific verb+resource ('查询指定图书的完整介绍') and enumerates the fields returned (书名、作者、出版社、ISBN、索书号、内容简介), so the agent knows exactly what it gets. It references search_books as the ID source but never states how it differs from find_book_availability, so sibling differentiation is only partial.

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

Usage Guidelines4/5

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

Gives a real prerequisite: book_id must come from search_books and must be paired with the same city used in that search, which is actionable context an agent would otherwise get wrong. It stops short of any when-not-to-use or explicit alternative routing.

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

search_booksSearch BooksA

按关键字搜索城市图书馆的馆藏图书,返回分页列表。

已接入城市:shanghai(上海,全市 900+ 网点,含地铁站 24 小时自助机);其他城市待接入。 keyword 可以是书名、ISBN、作者名等。每条结果带 book_id,是后续查询的凭据。 total_results 为 null 表示数据源不提供总数:用 page 继续翻页, 直到 has_next 为 false 或 books 为空。

参数: keyword:书名、ISBN、作者等检索词 city:城市标识,默认 "shanghai" page:页码,默认 1 limit:每页条数,默认 20

ParametersJSON Schema
NameRequiredDescriptionDefault
cityNoshanghai
pageNo
limitNo
keywordYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
pageYes
booksYes
has_nextYes
total_pagesYes
total_resultsYes

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the pagination contract (null total_results, iterate page until has_next is false or books is empty), states the actual data-source coverage limit (only shanghai, other cities pending), and explains the role of book_id as a follow-up credential. No auth, permission, or rate-limit details are given.

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?

Front-loaded with the core purpose, then operational notes (city coverage, paging), then parameters. Every sentence earns its place and the parameter block is justified given 0% schema coverage.

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

Completeness4/5

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

An output schema exists, so return fields needn't be explained, yet the description helpfully explains the semantics of total_results/has_next/books that the agent needs for paging. Combined with the parameter and coverage notes, the definition is essentially complete for calling this tool.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it does: keyword is defined semantically (title/ISBN/author), city is given its default and its only valid value, and page/limit are named with defaults. The page/limit descriptions add no behavior beyond the schema defaults, keeping it short of a 5.

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

Purpose4/5

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

States a specific verb and resource ('按关键字搜索...馆藏图书') plus scope (paginated list, city coverage). It hints at downstream use of book_id but never names the sibling tools (get_book_detail, find_book_availability), so an agent must infer the routing.

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

Usage Guidelines4/5

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

Gives clear context for use: keyword matching on title/ISBN/author, default city shanghai with only shanghai currently supported. It also explains the paging protocol when total_results is null, which is genuine when-to-continue guidance, though it offers no explicit when-not-to-use-this-tool statement.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedfind_book_availability
    • First observedget_book_detail
    • First observedsearch_books

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

The three tools have clearly distinct purposes: search_books for keyword search, find_book_availability for branch-level availability, and get_book_detail for bibliographic details. Despite overlap in parameters (book_id, city), the descriptions and return types make the boundaries unambiguous.

Naming Consistency5/5

All tool names use snake_case with a verb_noun pattern (search_books, find_book_availability, get_book_detail). The slight variation in verbs (search/find/get) is natural and consistent, not confusing.

Tool Count4/5

Three tools is slightly lean but well-scoped for a library search server. Each tool earns its place, and there is no bloat. A few more tools (e.g., branch listing) could add value without being excessive.

Completeness4/5

The surface covers the core search lifecycle: search, availability, and detail. Minor gaps exist (e.g., no way to list supported cities or browse branches), but these are workaroundable and not critical for the stated purpose.

Related MCP Connectors

Related MCP Servers

  • A
    license
    C
    quality
    B
    maintenance
    Provides comprehensive access to South Korea's National Library information system, enabling searches across 1,000+ public libraries, real-time book availability checks, borrowing trends, and location-based library discovery.
    27
    19 npm
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables AI clients to search Aspen Discovery library catalogs and check real-time book availability by keyword, author, or ISBN. This server allows users to verify local library inventory and filter book recommendations accordingly.
    2
    8 npm
    MIT