Skip to content

fix: sdef interrogator should prefer app bundle name over dictionary title #14

Description

@mickdarling

Summary

The sdef interrogator uses the <dictionary title="..."> attribute as the application name in the discovery bundle. This produces awkward names like "Mail Terminology" instead of "Mail", which then propagate through the entire pipeline to the generated package name (@mcpaql/generated-Mail Terminology-adapter).

Root Cause

In src/sdef-parser.ts, parseSdefFile extracts the title attribute from the root <dictionary> element and stores it as application. The sdef CLI then uses this as source.name in the discovery bundle.

Apple's sdef files use descriptive dictionary titles:

  • Mail → "Mail Terminology"
  • Other apps may use "Foo Scripting", "Bar Suite", etc.

Expected Behavior

The interrogator should prefer the app name derived from the --app flag or the bundle path, falling back to the dictionary title only if neither is available.

Priority order:

  1. --app CLI argument (e.g., "Mail")
  2. App bundle name parsed from sdef path (e.g., /Applications/Mail.app/... → "Mail")
  3. Dictionary title attribute (current behavior, as fallback only)

Impact

The name propagates through the full pipeline:

  • discovery-bundle.jsonsource.name
  • adapter-schema.jsonname field
  • Generated package → package.json name
  • MCP server → serverInfo.name
  • Introspection → _protocol.adapter

A bad name at stage 1 pollutes every downstream artifact.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions